@hmcts/ccd-case-ui-toolkit 7.3.43-4371 → 7.3.43-4371-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9837,7 +9837,7 @@ class CaseEditComponent {
9837
9837
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
9838
9838
  const [task, taskToBeCompleted] = userTask ? [userTask.task_data, userTask.complete_task] : [null, false];
9839
9839
  const assignNeeded = this.sessionStorageService.getItem('assignNeeded') === 'true';
9840
- if (this.caseDetails.case_id !== task?.case_id) {
9840
+ if (this.caseDetails && (this.caseDetails.case_id !== task?.case_id)) {
9841
9841
  this.abstractConfig.logMessage(`postCompleteTaskIfRequired: task in session storage with taskId ${task?.id} has caseId: ${task?.case_id} which does not match case details case id ${this.caseDetails.case_id}, NOT completing task and clearing client context`);
9842
9842
  this.sessionStorageService.removeItem(CaseEditComponent.CLIENT_CONTEXT);
9843
9843
  return of(true);