-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.4.6
-
Component/s: Shell
-
Environment:Linux
-
Fully Compatible
-
Linux
-
save() starts by this:
if ( obj == null || typeof( obj ) == "undefined" )
throw "can't save a null";
This is apparently to catch both null and undefined.
However, since the first check only uses == instead of ===, it matches undefined, and the second part of the check is never used. This could be improved in one of two ways:
- drop the second part of the check since it is unused anyway:
if ( obj == null)
throw "can't save a null"; - use an identical check for null
if ( obj === null || typeof( obj ) == "undefined" )
throw "can't save a null";