Merge pull request #35 from eordano/fix/various

Adds various small fixes to Encrypted local storage
This commit is contained in:
Matias Alejo Garcia 2014-10-27 12:11:22 -03:00
commit 5f7f60f4b9
5 changed files with 41 additions and 5 deletions

View file

@ -209,14 +209,14 @@ Identity.isAvailable = function(email, opts, cb) {
* @param {Function} cb
*/
Identity.prototype.storeWallet = function(wallet, cb) {
preconditions.checkArgument(w && _.isObject(wallet));
preconditions.checkArgument(wallet && _.isObject(wallet));
var val = wallet.toObj();
var key = wallet.getStorageKey();
this.storage.setItem(key, val, function(err) {
if (err) {
log.debug('Wallet:' + w.getName() + ' couldnt be stored');
log.debug('Wallet:' + wallet.getName() + ' couldnt be stored');
return cb(err);
}
return cb();