diff --git a/lib/keystore.js b/lib/keystore.js index 4dd02db7..d9d1b657 100644 --- a/lib/keystore.js +++ b/lib/keystore.js @@ -111,9 +111,12 @@ KeyStore.createVault = function(opts, cb) { if (err) return cb(err); var ks = new KeyStore(); - ks.init(opts.seedPhrase, pwDerivedKey, opts.hdPathString, opts.salt); - - cb(null, ks); + try{ + ks.init(opts.seedPhrase, pwDerivedKey, opts.hdPathString, opts.salt); + cb(null, ks); + } catch(err) { + cb(err, null); + } }); };