mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 09:22:31 -06:00
safety
This commit is contained in:
parent
d500a51d97
commit
1a618c3c97
|
@ -583,14 +583,22 @@ function jcp(obj) {
|
|||
|
||||
|
||||
function sread(key) {
|
||||
return localStorage.getItem(key);
|
||||
try {
|
||||
return localStorage.getItem(key);
|
||||
}
|
||||
catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function swrite(key, val) {
|
||||
if (val === undefined || val === null)
|
||||
localStorage.removeItem(key);
|
||||
else
|
||||
localStorage.setItem(key, val);
|
||||
try {
|
||||
if (val === undefined || val === null)
|
||||
localStorage.removeItem(key);
|
||||
else
|
||||
localStorage.setItem(key, val);
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
|
||||
function jread(key, fb) {
|
||||
|
|
Loading…
Reference in a new issue