Skip to content

Commit

Permalink
Handle private key undefined state in selectPrivateKeyWalletsByAddres…
Browse files Browse the repository at this point in the history
…s function
  • Loading branch information
rileystephens28 committed May 6, 2024
1 parent 8ef2732 commit 0f9d72c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions background/redux-slices/selectors/keyringsSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ export const selectKeyringsByAddresses = createSelector(
export const selectPrivateKeyWalletsByAddress = createSelector(
(state: RootState) => state.keyrings.privateKeys,
(privateKeys): { [address: HexString]: PrivateKey } =>
Object.fromEntries(
privateKeys.map((wallet) => [wallet.addresses[0], wallet])
)
!privateKeys
? {}
: Object.fromEntries(
privateKeys.map((wallet) => [wallet.addresses[0], wallet])
)
)

export const selectSourcesByAddress = createSelector(
Expand Down

0 comments on commit 0f9d72c

Please sign in to comment.