You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (var i = 0, k; i < webStorage.length && (k = webStorage.key(i)); i++) {
'ngStorage-' === k.slice(0, 10) && ($storage[k.slice(10)] = angular.fromJson(webStorage.getItem(k)));
}
i changed it to:
for (var i = 0, k; i < webStorage.length; i++) {
if ((k = webStorage.key(i))) {
'ngStorage-' === k.slice(0, 10) && ($storage[k.slice(10)] = angular.fromJson(webStorage.getItem(k)));
}
}
and then it works, because it shouldn't completely skip the whole loop if somehow "k" evalutes to false (because the key is an empty string)
somehow i get such a key in my local and session storage, can't currently find out why that is (""=null) i don't use the local and session storage at all my self so it must be a 3th party lib, that maybe tries to test if the storage are available and doesn't remove that key
But nsStorage shouldn't just not work if a key is not what it expects it to be (if that is not a key of nsStorage itself)
The text was updated successfully, but these errors were encountered:
this is because the code has this if:
for (var i = 0, k; i < webStorage.length && (k = webStorage.key(i)); i++) {
'ngStorage-' === k.slice(0, 10) && ($storage[k.slice(10)] = angular.fromJson(webStorage.getItem(k)));
}
i changed it to:
for (var i = 0, k; i < webStorage.length; i++) {
if ((k = webStorage.key(i))) {
'ngStorage-' === k.slice(0, 10) && ($storage[k.slice(10)] = angular.fromJson(webStorage.getItem(k)));
}
}
and then it works, because it shouldn't completely skip the whole loop if somehow "k" evalutes to false (because the key is an empty string)
somehow i get such a key in my local and session storage, can't currently find out why that is (""=null) i don't use the local and session storage at all my self so it must be a 3th party lib, that maybe tries to test if the storage are available and doesn't remove that key
But nsStorage shouldn't just not work if a key is not what it expects it to be (if that is not a key of nsStorage itself)
The text was updated successfully, but these errors were encountered: