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