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;
}
if (opt.selectedIcon === null || opt.selectedIcon === undefined) {
selectedIcon = 'Default';
} else {
selectedIcon = opt.selectedIcon;
}
if (selectedIcon === 'Default') {
document.getElementById('icon-default').checked = true;

View File

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

View File

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

View File

@ -28,6 +28,7 @@
<p>Improved</p>
<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>Firefox Sync (<a href="https://codeberg.org/nobody/LocalCDN/issues/1510">#1510</a>)</li>
</ul>
</div>
<div id="generator-section">