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) {