Set default if a configuration element is missing (#92)
This commit is contained in:
parent
6a80106def
commit
e2536dff2e
|
@ -144,6 +144,9 @@ storageManager._validation = function (content) {
|
||||||
} else if (typeof value === 'boolean' || value instanceof Boolean) {
|
} else if (typeof value === 'boolean' || value instanceof Boolean) {
|
||||||
imported[key] = content[key];
|
imported[key] = content[key];
|
||||||
}
|
}
|
||||||
|
} else if (content[key] === undefined) {
|
||||||
|
// Set default if not existing in file
|
||||||
|
imported[key] = value;
|
||||||
} else {
|
} else {
|
||||||
alert(chrome.i18n.getMessage('dialogImportFailed'));
|
alert(chrome.i18n.getMessage('dialogImportFailed'));
|
||||||
throw 'Invalid file!';
|
throw 'Invalid file!';
|
||||||
|
|
Loading…
Reference in New Issue