mirror of https://github.com/BTCPrivate/copay.git
Add error checking when importing a wallet from a corrupt file
This commit is contained in:
parent
cfb29e8e8f
commit
05c8200749
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue