From d0acbdfd58ebf89bcc4d6a6523d46b6b13ecd1d0 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 25 Apr 2022 16:29:55 -0500 Subject: [PATCH] fix issue where qr keyring does not expect an empty options object --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); }