browser/js/global.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 61718fca174489f93fc317200a9fc2fa4c63f241
Author: Andras Timar <
andras...@collabora.com>
AuthorDate: Wed Apr 22 16:21:35 2026 +0200
Commit: Miklos Vajna <
vmi...@collabora.com>
CommitDate: Thu Apr 23 07:16:06 2026 +0000
browser: fix uncaught TypeError when prefs are re-read after remove()
prefs.remove(key) stored undefined into _localStorageCache[key] instead
of deleting the entry. A subsequent prefs.get(key, default) then saw the
key as present (key in cache) and returned the cached undefined,
ignoring the caller-supplied default. prefs.getBoolean then called
.toLowerCase() on that undefined and surfaced as a "Cannot read
properties of undefined" exception popup during viewinfo handling
(reproduced by Map.Welcome.shouldWelcome, which itself remove()s the
expired WSDWelcomeDisabled key and re-reads it on the next tick).
Fix remove() to actually delete the cache entry, and treat an undefined
cached value in get() as a miss so any residual poisoning can no longer
short-circuit the default.
Signed-off-by: Andras Timar <
andras...@collabora.com>
Change-Id: I5f2dac719c26cc879829a0572c50ceb877e15cfd
Reviewed-on:
https://gerrit.collaboraoffice.com/c/online/+/1394
Tested-by: Jenkins CPCI <
rel...@collaboraoffice.com>
Reviewed-by: Miklos Vajna <
vmi...@collabora.com>
diff --git a/browser/js/global.js b/browser/js/global.js
index d3413cef86fc..752b862ac42e 100644
--- a/browser/js/global.js
+++ b/browser/js/global.js
@@ -896,7 +896,7 @@ function showWelcomeSVG() {
},
get: function(key, defaultValue = undefined) {
- if (key in global.prefs._localStorageCache) {
+ if (global.prefs._localStorageCache[key] !== undefined) {
return global.prefs._localStorageCache[key];
}
@@ -996,7 +996,7 @@ function showWelcomeSVG() {
if (global.prefs.canPersist) {
global.localStorage.removeItem(key);
}
- global.prefs._localStorageCache[key] = undefined;
+ delete global.prefs._localStorageCache[key];
},
getBoolean: function(key, defaultValue = false) {