diff --git a/index.js b/index.js index 4c0ac7a0..cb0aa422 100644 --- a/index.js +++ b/index.js @@ -198,10 +198,10 @@ class KeyringController extends EventEmitter { * @param {Object} opts - The constructor options for the keyring. * @returns {Promise} The new keyring. */ - addNewKeyring(type, opts = {}) { + addNewKeyring(type, opts) { const Keyring = this.getKeyringClassForType(type); const keyring = new Keyring(opts); - if (!opts.mnemonic && type === KEYRINGS_TYPE_MAP.HD_KEYRING) { + if ((!opts || !opts.mnemonic) && type === KEYRINGS_TYPE_MAP.HD_KEYRING) { keyring.generateRandomMnemonic(); keyring.addAccounts(); }