diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index bde3215a2..85d2e58cf 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -203,10 +203,14 @@ angular.module('copayApp.services') root.getProfile = function(cb) { storage.get('profile', function(getErr, getStr) { if (getErr) { - cb(getErr, null); + return cb(getErr, null); } else { - profile = Profile.fromString(getStr); - cb(null, profile); + if (!getStr) { + return cb(null, null); + } else { + profile = Profile.fromString(getStr); + return cb(null, profile); + } } }); };