1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

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

This commit is contained in:
ryanml 2021-08-27 08:46:56 -07:00 committed by GitHub
parent 49c327aec3
commit 58f9299df2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {