Improve handling empty variables (#1510)

This commit is contained in:
nobody 2023-10-24 06:23:10 +02:00
parent 822192dcbb
commit 96f86f766f
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
4 changed files with 10 additions and 3 deletions

View File

@ -34,7 +34,11 @@ optionsOther._renderIconSection = function (opt) {
return; return;
} }
selectedIcon = opt.selectedIcon; if (opt.selectedIcon === null || opt.selectedIcon === undefined) {
selectedIcon = 'Default';
} else {
selectedIcon = opt.selectedIcon;
}
if (selectedIcon === 'Default') { if (selectedIcon === 'Default') {
document.getElementById('icon-default').checked = true; document.getElementById('icon-default').checked = true;

View File

@ -196,7 +196,7 @@ options._configureLinkPrefetching = function (value) {
}; };
options._serializeAllowlistedDomains = function (allowlistedDomains) { options._serializeAllowlistedDomains = function (allowlistedDomains) {
if (allowlistedDomains === undefined) { if (allowlistedDomains === undefined || allowlistedDomains === null) {
return ''; return '';
} }

View File

@ -295,7 +295,9 @@ popup._determineStatusGoogleFonts = function () {
}; };
chrome.runtime.sendMessage(message, function (response) { chrome.runtime.sendMessage(message, function (response) {
popup._domainGoogleFonts = response.value; if (response !== undefined) {
popup._domainGoogleFonts = response.value;
}
resolve(); resolve();
}); });
}); });

View File

@ -28,6 +28,7 @@
<p>Improved</p> <p>Improved</p>
<ul> <ul>
<li>Allow Google fonts for Google services by default and permanently (<a href="https://codeberg.org/nobody/LocalCDN/issues/1560">#1560</a>)</li> <li>Allow Google fonts for Google services by default and permanently (<a href="https://codeberg.org/nobody/LocalCDN/issues/1560">#1560</a>)</li>
<li>Firefox Sync (<a href="https://codeberg.org/nobody/LocalCDN/issues/1510">#1510</a>)</li>
</ul> </ul>
</div> </div>
<div id="generator-section"> <div id="generator-section">