Merge pull request #1827 from matiaspando/feature/checkProfile

Add error checking when importing a wallet from a corrupt file
This commit is contained in:
Matias Alejo Garcia 2014-11-18 17:02:41 -03:00
commit 27ff17c86e

View file

@ -1035,8 +1035,12 @@ Wallet.fromObj = function(o, readOpts) {
// TODO Why moving everything to opts. This needs refactoring.
//
// clone opts
var opts = JSON.parse(JSON.stringify(o.opts));
if (!o.opts) {
return null;
}
var opts = JSON.parse(JSON.stringify(o.opts));
opts.addressBook = o.addressBook;
opts.settings = o.settings;