From d621c9601bcf9b6a2145ba740a103e762591ae4d Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 7 Jun 2016 12:34:16 -0300 Subject: [PATCH] fix err message --- src/js/services/profileService.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index dde981f2f..b3b4322c2 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -324,7 +324,8 @@ angular.module('copayApp.services') opts.network = 'livenet'; doCreateWallet(opts, function(err, walletClient) { - if (err) return bwsError.cb(err, gettext('Error creating wallet'), cb); + if (err) return cb(err); + p.addWallet(JSON.parse(walletClient.export())); return cb(null, p); }); @@ -333,6 +334,8 @@ angular.module('copayApp.services') // create and store a wallet root.createWallet = function(opts, cb) { doCreateWallet(opts, function(err, walletClient, secret) { + if (err) return cb(err); + root.addAndBindWalletClient(walletClient, { bwsurl: opts.bwsurl }, cb); @@ -431,6 +434,9 @@ angular.module('copayApp.services') // Adds and bind a new client to the profile root.addAndBindWalletClient = function(client, opts, cb) { + if (!client || !client.credentials) + return cb(gettext('Could not access wallet')); + var walletId = client.credentials.walletId if (!root.profile.addWallet(JSON.parse(client.export())))