From 58f9299df244cd283aa51f42464799e48154a9b9 Mon Sep 17 00:00:00 2001 From: ryanml Date: Fri, 27 Aug 2021 08:46:56 -0700 Subject: [PATCH] Guarding against null keyring (Hardware Wallet Selectors) (#11893) --- ui/selectors/selectors.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index deed331b1..a7c3fbed7 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -100,7 +100,7 @@ export function checkNetworkAndAccountSupports1559(state) { */ export function isHardwareWallet(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) { const keyring = getCurrentKeyring(state); - return keyring.type.includes('Hardware') ? keyring.type : undefined; + return isHardwareWallet(state) ? keyring.type : undefined; } export function getAccountType(state) {