From d669f86c7db31d787fb484810f961fa2bbe1e50d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 6 Nov 2015 16:04:35 -0300 Subject: [PATCH] solve empty addrbook and histCache bug --- src/js/services/profileService.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index db48ae83e..a99fe69ef 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -381,7 +381,7 @@ angular.module('copayApp.services') root.importWallet = function(str, opts, cb) { if (opts.bwsurl) bwcService.setBaseUrl(opts.bwsurl); - console.log(str); + var walletClient = bwcService.getClient(); $log.debug('Importing Wallet:', opts); @@ -393,7 +393,10 @@ angular.module('copayApp.services') } catch (err) { return cb(gettext('Could not import. Check input file and password')); } - root.setMetaData(walletClient, str.addressBook, str.historyCache, function(err) { + var addressBook = str.addressBook || []; + var historyCache = str.historyCache ||  []; + + root.setMetaData(walletClient, addressBook, historyCache, function(err) { if (err) console.log(err); root._addWalletClient(walletClient, opts, cb);