Fix - setting can be null sometimes (autosave)

This commit is contained in:
cmdr2
2022-11-14 18:10:23 +05:30
parent e252c9ac05
commit ab6ec3a9b7
2 changed files with 4 additions and 1 deletions

View File

@@ -277,6 +277,9 @@ function tryLoadOldSettings() {
var localStorageValue = localStorage.getItem(localStorageKey);
if (localStorageValue !== null) {
var setting = SETTINGS[individual_settings_map[localStorageKey]]
if (setting == null || setting == undefined) {
return
}
if (setting.element.type == "checkbox" && (typeof localStorageValue === "string" || localStorageValue instanceof String)) {
localStorageValue = localStorageValue == "true"
}