From 2d557a441177b0916a360637b5632bf412e92b81 Mon Sep 17 00:00:00 2001 From: Andy Wilkins <49269487+andywilkinshmcts@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:48:26 +0100 Subject: [PATCH] Fix exception in log message (#1768) --- package.json | 2 +- projects/ccd-case-ui-toolkit/package.json | 2 +- .../case-editor/services/work-allocation.service.ts | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index eeab64b37..3231182ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hmcts/ccd-case-ui-toolkit", - "version": "7.0.61", + "version": "7.0.62", "engines": { "node": ">=18.19.0" }, diff --git a/projects/ccd-case-ui-toolkit/package.json b/projects/ccd-case-ui-toolkit/package.json index 4aa0d15d3..35536b349 100644 --- a/projects/ccd-case-ui-toolkit/package.json +++ b/projects/ccd-case-ui-toolkit/package.json @@ -1,6 +1,6 @@ { "name": "@hmcts/ccd-case-ui-toolkit", - "version": "7.0.61", + "version": "7.0.62", "engines": { "node": ">=18.19.0" }, diff --git a/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-editor/services/work-allocation.service.ts b/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-editor/services/work-allocation.service.ts index bba76c425..4abe9447a 100644 --- a/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-editor/services/work-allocation.service.ts +++ b/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-editor/services/work-allocation.service.ts @@ -53,8 +53,13 @@ export class WorkAllocationService { private isWAEnabled(jurisdiction?: string, caseType?: string): boolean { this.features = this.appConfig.getWAServiceConfig(); - const ftstr = JSON.stringify(this.features); - this.appConfig.logMessage(`isWAEnabled: wa-service-config returning ${ftstr.length > 0}`); + if (this.features) { + const ftstr = JSON.stringify(this.features); + this.appConfig?.logMessage(`isWAEnabled: wa-service-config returning ${ftstr?.length > 0}`); + } else { + this.appConfig?.logMessage(`isWAEnabled: wa-service-config returning no features`); + return false; + } let enabled = false; if (!jurisdiction || !caseType) { const caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo'));