LocalStorage returns undefined for any key not present (#431)

This commit is contained in:
Paul Betts 2017-03-13 20:43:57 -07:00 committed by Andrew E. Rhyne
parent ce4d93e71d
commit 0fb8ea4730

View File

@ -148,14 +148,17 @@ function save(namespaces) {
*/
function load() {
var r;
try {
return exports.storage.debug;
r = exports.storage.debug;
} catch(e) {}
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
if (typeof process !== 'undefined' && 'env' in process) {
return process.env.DEBUG;
if (!r && typeof process !== 'undefined' && 'env' in process) {
r = process.env.DEBUG;
}
return r;
}
/**