Skip to content

Commit 4eb19d1

Browse files
Fix storage usage when disabled
1 parent 8b36867 commit 4eb19d1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/librustdoc/html/static/storage.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,11 @@ function usableLocalStorage() {
6464
// preferences deny access to localStorage, e.g., to prevent storage of
6565
// "cookies" (or cookie-likes, as is the case here).
6666
try {
67-
window.localStorage;
67+
return window.localStorage !== null && window.localStorage !== undefined;
6868
} catch(err) {
6969
// Storage is supported, but browser preferences deny access to it.
7070
return false;
7171
}
72-
73-
return true;
7472
}
7573

7674
function updateLocalStorage(name, value) {

0 commit comments

Comments
 (0)