mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-25 20:02:58 +01:00
Guarding against null keyring (Hardware Wallet Selectors) (#11893)
This commit is contained in:
parent
49c327aec3
commit
58f9299df2
@ -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…
Reference in New Issue
Block a user