From 2e9b48be7ca7277319721a87b95de766ca8b2dd2 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 22 Jan 2025 12:12:11 +0100 Subject: [PATCH] fix(qualifikation-form): prevent adding invalid employee ID --- .../qualifikation-form/qualifikation-form.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/components/qualifikation-form/qualifikation-form.component.ts b/src/app/components/qualifikation-form/qualifikation-form.component.ts index aad7492..03c1353 100644 --- a/src/app/components/qualifikation-form/qualifikation-form.component.ts +++ b/src/app/components/qualifikation-form/qualifikation-form.component.ts @@ -55,6 +55,9 @@ export class QualifikationFormComponent { addEmployee() { const employeeId = Number(this.skillForm.get("newEmployee")?.value); + if (!employeeId) { + return; + } const employee = this.addableEmployees.find(emp => emp.id === employeeId); if (employee) {