web: fix crash when location url is /

This commit is contained in:
Abdullah Atta
2022-08-31 07:34:43 +05:00
parent 0080dac352
commit 8bd9717930

View File

@@ -25,7 +25,7 @@ function set<T>(key: string, value: T) {
function get<T>(key: string, def?: T): T {
const value = window.localStorage.getItem(key);
if (!value && def) return def;
if (!value && def !== undefined) return def;
return tryParse(value);
}