Skip to content

Commit a66071b

Browse files
authored
[Fix] Correct integer check logic in middleware function (#3905)
1 parent 306f3da commit a66071b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/dashboard/src/middleware.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ export async function middleware(request: NextRequest) {
5151

5252
// if the first section of the path is a number, check if it's a valid chain_id and re-write it to the slug
5353
const possibleChainId = Number(paths[0]);
54-
if (Number.isInteger(possibleChainId) && possibleChainId !== 404) {
54+
55+
if (
56+
possibleChainId &&
57+
Number.isInteger(possibleChainId) &&
58+
possibleChainId !== 404
59+
) {
5560
const possibleChain = defineChain(possibleChainId);
5661
try {
5762
const chainMetadata = await getChainMetadata(possibleChain);

0 commit comments

Comments
 (0)