Improve null checks in content scripts (#2390)
This commit is contained in:
parent
04fe9d1519
commit
9189d4d21e
|
@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue