mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[DURACOM-309] fix error occurring when preferences is undefined
This commit is contained in:
@@ -20,7 +20,10 @@ import {
|
||||
CORRELATION_ID_COOKIE,
|
||||
CORRELATION_ID_OREJIME_KEY,
|
||||
} from '../shared/cookies/orejime-configuration';
|
||||
import { isEmpty } from '../shared/empty.util';
|
||||
import {
|
||||
hasValue,
|
||||
isEmpty,
|
||||
} from '../shared/empty.util';
|
||||
import { SetCorrelationIdAction } from './correlation-id.actions';
|
||||
import { correlationIdSelector } from './correlation-id.selector';
|
||||
|
||||
@@ -49,7 +52,7 @@ export class CorrelationIdService {
|
||||
*/
|
||||
initCorrelationId(): void {
|
||||
this.orejimeService?.getSavedPreferences().subscribe(preferences => {
|
||||
if (preferences[CORRELATION_ID_OREJIME_KEY]) {
|
||||
if (hasValue(preferences) && preferences[CORRELATION_ID_OREJIME_KEY]) {
|
||||
this.setCorrelationId();
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user