Skip to content

Commit 38d5e12

Browse files
committed
Merge pull request STRML#123 from jsg2021/default-localstorage-path
LocalStorageKeyEnvironment: Default to empty string instead of undefined/null
2 parents 9e59cae + fbb08f5 commit 38d5e12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/environment/LocalStorageKeyEnvironment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LocalStorageKeyEnvironment.prototype = Object.create(Environment.prototype);
1515
LocalStorageKeyEnvironment.prototype.constructor = LocalStorageKeyEnvironment;
1616

1717
LocalStorageKeyEnvironment.prototype.getPath = function() {
18-
return window.localStorage.getItem(this.key);
18+
return window.localStorage.getItem(this.key) || '';
1919
};
2020

2121
LocalStorageKeyEnvironment.prototype.pushState = function(path, navigation) {

0 commit comments

Comments
 (0)