Directly loading invalid LocalStorage record throws an exception
Directly loading an invalid LocalStorage record throws an exception instead of calling provided failure callback.
I am attempting to check if a record is in local storage on startup using something like the following test case. Instead of calling the failure callback an error is being thrown.
WebStorage.js:201
Uncaught TypeError: Cannot read property 'id' of null
Code:
Ext.define('User', {
extend: 'Ext.data.Model',
fields: ['id', 'name'],
proxy: {
type: 'localstorage',
id: 'user'
}
});
Ext.onReady(function() {
var User = Ext.ModelManager.getModel('User');
User.load(1, {
success: function(user) {
console.dir(user);
},
failure: function() {
console.log('Failure');
}
});
});