Improve null checks in content scripts (#2390)

This commit is contained in:
Oscar Hinton 2022-02-15 16:11:44 +01:00 committed by Hinton
parent 04fe9d1519
commit 9189d4d21e
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
}); });
chrome.storage.local.get(activeUserId, (obj: any) => { chrome.storage.local.get(activeUserId, (obj: any) => {
if (obj != null && obj[activeUserId].settings.enableAutoFillOnPageLoad === true) { if (obj?.[activeUserId]?.settings?.enableAutoFillOnPageLoad === true) {
setInterval(() => doFillIfNeeded(), 500); setInterval(() => doFillIfNeeded(), 500);
} }
}); });

View File

@ -58,7 +58,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
}); });
chrome.storage.local.get(activeUserId, (obj: any) => { chrome.storage.local.get(activeUserId, (obj: any) => {
if (obj === null) { if (obj?.[activeUserId] == null) {
return; return;
} }