mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 13:33:03 +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_COOKIE,
|
||||||
CORRELATION_ID_OREJIME_KEY,
|
CORRELATION_ID_OREJIME_KEY,
|
||||||
} from '../shared/cookies/orejime-configuration';
|
} 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 { SetCorrelationIdAction } from './correlation-id.actions';
|
||||||
import { correlationIdSelector } from './correlation-id.selector';
|
import { correlationIdSelector } from './correlation-id.selector';
|
||||||
|
|
||||||
@@ -49,7 +52,7 @@ export class CorrelationIdService {
|
|||||||
*/
|
*/
|
||||||
initCorrelationId(): void {
|
initCorrelationId(): void {
|
||||||
this.orejimeService?.getSavedPreferences().subscribe(preferences => {
|
this.orejimeService?.getSavedPreferences().subscribe(preferences => {
|
||||||
if (preferences[CORRELATION_ID_OREJIME_KEY]) {
|
if (hasValue(preferences) && preferences[CORRELATION_ID_OREJIME_KEY]) {
|
||||||
this.setCorrelationId();
|
this.setCorrelationId();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user