Skip to content

Commit f8ea210

Browse files
committed
fix(controller-utils): add radix to parseInt call in isSafeChainId
1 parent 90dbb10 commit f8ea210

File tree

1 file changed

+4
-1
lines changed
  • packages/controller-utils/src

1 file changed

+4
-1
lines changed

packages/controller-utils/src/util.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export function isSafeChainId(chainId: Hex): boolean {
2828
if (!isHexString(chainId)) {
2929
return false;
3030
}
31-
const decimalChainId = Number.parseInt(chainId);
31+
const decimalChainId = Number.parseInt(
32+
chainId,
33+
isStrictHexString(chainId) ? 16 : 10,
34+
);
3235
return (
3336
Number.isSafeInteger(decimalChainId) &&
3437
decimalChainId > 0 &&

0 commit comments

Comments
 (0)