Skip to content

Commit

Permalink
Add type gate to address
Browse files Browse the repository at this point in the history
  • Loading branch information
DDDDDanica committed Sep 19, 2024
1 parent b582c30 commit c4d9e3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/scripts/lib/AddressBookPetnamesBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
NameType,
NameOrigin,
} from '@metamask/name-controller';
import type { Hex } from '@metamask/utils';
import { Hex, isStrictHexString } from '@metamask/utils';
import {
AbstractPetnamesBridge,
PetnamesBridgeMessenger,
Expand Down Expand Up @@ -55,6 +55,10 @@ export class AddressBookPetnamesBridge extends AbstractPetnamesBridge<
const chainEntries = state.addressBook[chainId as Hex];

for (const address of Object.keys(chainEntries)) {
if (!isStrictHexString(chainId)) {
continue;
}

const entry = state.addressBook[chainId as Hex][address];
const normalizedChainId = chainId.toLowerCase();
const { name, isEns } = entry;
Expand Down

0 comments on commit c4d9e3f

Please sign in to comment.