From d246965cfb20c60b78b9d3b9ec5b0117875e833a Mon Sep 17 00:00:00 2001 From: Davide Negretti Date: Tue, 21 Dec 2021 11:17:12 +0100 Subject: [PATCH] [CST-4879] TypeError fixed --- .../file/edit/section-upload-file-edit.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts index fda86dd629..3a43e718a0 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts @@ -243,12 +243,12 @@ export class SubmissionSectionUploadFileEditComponent implements OnInit { const endDateControl: FormControl = control.parent.get('endDate') as FormControl; // Clear previous state - startDateControl.markAsUntouched(); - endDateControl.markAsUntouched(); + startDateControl?.markAsUntouched(); + endDateControl?.markAsUntouched(); - startDateControl.setValue(null); + startDateControl?.setValue(null); control.parent.markAsDirty(); - endDateControl.setValue(null); + endDateControl?.setValue(null); if (showGroups) { if (accessCondition.hasStartDate) {