diff --git a/web/src/app/workplace/taskdetails/general/general-fields.component.html b/web/src/app/workplace/taskdetails/general/general-fields.component.html index 837fdba27..e16ad7d3f 100644 --- a/web/src/app/workplace/taskdetails/general/general-fields.component.html +++ b/web/src/app/workplace/taskdetails/general/general-fields.component.html @@ -65,9 +65,13 @@ diff --git a/web/src/app/workplace/taskdetails/general/general-fields.component.ts b/web/src/app/workplace/taskdetails/general/general-fields.component.ts index 732608725..ec4cd5a30 100644 --- a/web/src/app/workplace/taskdetails/general/general-fields.component.ts +++ b/web/src/app/workplace/taskdetails/general/general-fields.component.ts @@ -52,7 +52,6 @@ export class TaskdetailsGeneralFieldsComponent implements OnInit, OnChanges { this.classificationService.getClassifications().subscribe(classificationList => { this.requestInProgress = false; this.classifications = classificationList; - if (classificationList.length > 0) { this.task.classificationSummaryResource = classificationList[0]; } this.classificationsReceived.emit(this.classifications); }); } diff --git a/web/src/app/workplace/taskmaster/task-master.component.ts b/web/src/app/workplace/taskmaster/task-master.component.ts index b66bb2691..f5d5118a8 100644 --- a/web/src/app/workplace/taskmaster/task-master.component.ts +++ b/web/src/app/workplace/taskmaster/task-master.component.ts @@ -154,11 +154,11 @@ export class TaskMasterComponent implements OnInit, OnDestroy { } ngOnDestroy(): void { - this.taskChangeSubscription.unsubscribe(); - this.taskDeletedSubscription.unsubscribe(); - this.workbasketChangeSubscription.unsubscribe(); - this.taskAddedSubscription.unsubscribe(); - this.orientationSubscription.unsubscribe(); - this.objectReferenceSubscription.unsubscribe(); + if (this.taskChangeSubscription) { this.taskChangeSubscription.unsubscribe(); } + if (this.taskDeletedSubscription) { this.taskDeletedSubscription.unsubscribe(); } + if (this.workbasketChangeSubscription) { this.workbasketChangeSubscription.unsubscribe(); } + if (this.taskAddedSubscription) { this.taskAddedSubscription.unsubscribe(); } + if (this.orientationSubscription) { this.orientationSubscription.unsubscribe(); } + if (this.objectReferenceSubscription) { this.objectReferenceSubscription.unsubscribe(); } } }