handle get keys exception

This commit is contained in:
Gabriel Bazán 2016-09-08 16:19:45 -03:00
commit d5766485ec
2 changed files with 5 additions and 6 deletions

View file

@ -25,6 +25,7 @@ angular.module('copayApp.controllers').controller('backupController',
walletService.getKeys(wallet, function(err, k) { walletService.getKeys(wallet, function(err, k) {
if (err || !k) { if (err || !k) {
$log.error('Could not get keys: ', err);
$state.go('wallet.preferences'); $state.go('wallet.preferences');
return; return;
} }

View file

@ -956,8 +956,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
$rootScope.$emit('Local/TxAction', wallet.id); $rootScope.$emit('Local/TxAction', wallet.id);
var type = root.getViewStatus(wallet, broadcastedTxp); var type = root.getViewStatus(wallet, broadcastedTxp);
root.openStatusModal(type, broadcastedTxp, function() { root.openStatusModal(type, broadcastedTxp, function() {});
});
return cb(null, broadcastedTxp) return cb(null, broadcastedTxp)
}); });
@ -965,8 +964,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
$rootScope.$emit('Local/TxAction', wallet.id); $rootScope.$emit('Local/TxAction', wallet.id);
var type = root.getViewStatus(wallet, signedTxp); var type = root.getViewStatus(wallet, signedTxp);
root.openStatusModal(type, signedTxp, function() { root.openStatusModal(type, signedTxp, function() {});
});
return cb(null, signedTxp); return cb(null, signedTxp);
} }
}); });
@ -1032,7 +1030,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
try { try {
keys = wallet.getKeys(password); keys = wallet.getKeys(password);
} catch (e) { } catch (e) {
return cb(err); return cb(e);
} }
return cb(null, keys); return cb(null, keys);