Commit fe8b0a19 by Иван Кубота

fix empty load

parent 7b1945f7
...@@ -487,11 +487,11 @@ Store.SaveInterface.LocalStorage = function(key, store) { ...@@ -487,11 +487,11 @@ Store.SaveInterface.LocalStorage = function(key, store) {
}; };
Store.SaveInterface.LocalStorage.prototype = { Store.SaveInterface.LocalStorage.prototype = {
load: function(cb) { load: function(cb) {
var data = {}; var data;
try{ try{
data = JSON.parse( localStorage.getItem( this.key ) ); data = JSON.parse( localStorage.getItem( this.key ) );
}catch(e){} }catch(e){}
cb && cb(false, data); cb && cb(false, data || {});
return data; return data;
}, },
// Should support full save if arguments.length === 0 // Should support full save if arguments.length === 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment