Guarding against null keyring (Hardware Wallet Selectors) (#11893)

feature/default_network_editable
ryanml 3 years ago committed by GitHub
parent 49c327aec3
commit 58f9299df2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ui/selectors/selectors.js

@ -100,7 +100,7 @@ export function checkNetworkAndAccountSupports1559(state) {
*/ */
export function isHardwareWallet(state) { export function isHardwareWallet(state) {
const keyring = getCurrentKeyring(state); const keyring = getCurrentKeyring(state);
return keyring.type.includes('Hardware'); return Boolean(keyring?.type?.includes('Hardware'));
} }
/** /**
@ -110,7 +110,7 @@ export function isHardwareWallet(state) {
*/ */
export function getHardwareWalletType(state) { export function getHardwareWalletType(state) {
const keyring = getCurrentKeyring(state); const keyring = getCurrentKeyring(state);
return keyring.type.includes('Hardware') ? keyring.type : undefined; return isHardwareWallet(state) ? keyring.type : undefined;
} }
export function getAccountType(state) { export function getAccountType(state) {

Loading…
Cancel
Save