Skip to content

Commit 056351d

Browse files
author
Andrea Barbasso
committed
[DURACOM-309] fix error occurring when preferences is undefined
1 parent 87e4a33 commit 056351d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/app/correlation-id/correlation-id.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import {
2020
CORRELATION_ID_COOKIE,
2121
CORRELATION_ID_OREJIME_KEY,
2222
} from '../shared/cookies/orejime-configuration';
23-
import { isEmpty } from '../shared/empty.util';
23+
import {
24+
hasValue,
25+
isEmpty,
26+
} from '../shared/empty.util';
2427
import { SetCorrelationIdAction } from './correlation-id.actions';
2528
import { correlationIdSelector } from './correlation-id.selector';
2629

@@ -49,7 +52,7 @@ export class CorrelationIdService {
4952
*/
5053
initCorrelationId(): void {
5154
this.orejimeService?.getSavedPreferences().subscribe(preferences => {
52-
if (preferences[CORRELATION_ID_OREJIME_KEY]) {
55+
if (hasValue(preferences) && preferences[CORRELATION_ID_OREJIME_KEY]) {
5356
this.setCorrelationId();
5457
}
5558
},

0 commit comments

Comments
 (0)