We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a26c3de commit 4f63e4cCopy full SHA for 4f63e4c
src/librustdoc/html/static/js/storage.js
@@ -28,7 +28,11 @@ function getSettingValue(settingName) {
28
// This prevents an injection vulnerability where someone could plant
29
// JS code into the localStorage value, which could be executed when
30
// we pull it out.
31
- return current.replace(/[\s()[\]{}*"'`<>.:;=&|]/g,"");
+ if (current) {
32
+ return current.replace(/[\s()[\]{}*"'`<>.:;=&|]/g,"");
33
+ }
34
+
35
+ return null;
36
}
37
38
const localStoredTheme = getSettingValue("theme");
0 commit comments