summaryrefslogtreecommitdiff
path: root/ext/js/display/display-history.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/display/display-history.js')
-rw-r--r--ext/js/display/display-history.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/js/display/display-history.js b/ext/js/display/display-history.js
index 67690219..bc4f1539 100644
--- a/ext/js/display/display-history.js
+++ b/ext/js/display/display-history.js
@@ -37,9 +37,15 @@ export class DisplayHistory extends EventDispatcher {
this._historyMap = new Map();
const historyState = history.state;
- const {id, state} = isObject(historyState) ? historyState : {id: null, state: null};
+ const {id, state} = (
+ typeof historyState === 'object' && historyState !== null ?
+ historyState :
+ {id: null, state: null}
+ );
+ /** @type {?import('display-history').EntryState} */
+ const stateObject = typeof state === 'object' || state === null ? state : null;
/** @type {import('display-history').Entry} */
- this._current = this._createHistoryEntry(id, location.href, state, null, null);
+ this._current = this._createHistoryEntry(id, location.href, stateObject, null, null);
}
/** @type {?import('display-history').EntryState} */