Skip to content

Commit 91c7e39

Browse files
author
Chris K
committed
Simplified boolean checks.
1 parent aab27c6 commit 91c7e39

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib/storageprototype.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Storage.prototype.get_and_parse_item = function(key, default_value)
99
catch(e)
1010
{
1111
value = default_value;
12-
};
13-
return value === null || value === undefined ? default_value : value;
12+
}
13+
return value == null ? default_value : value;
1414
};
1515

1616
Storage.prototype.stringify_and_set_item = function(key, value)

src/ui-scripts/settings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ var SettingsBase = function()
3131
*/
3232
this.get = function(key)
3333
{
34-
if (typeof this.map[key] == "undefined")
34+
if (this.map[key] == null)
3535
this.map[key] = this._storage.get_and_parse_item(key, this._default_values[key]);
36-
return this.map[key]
36+
return this.map[key];
3737
};
3838

3939
/**

0 commit comments

Comments
 (0)