Skip to content

Commit

Permalink
fix: access non existing protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
pradel committed Mar 24, 2024
1 parent 0c4718f commit 7a98647
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/protocols/[protocol]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
isAction,
protocolsActions,
} from "@/lib/actions";
import { type Protocol, isProtocol, protocolsInfo } from "@/lib/protocols";
import { isProtocol, protocolsInfo } from "@/lib/protocols";
import {
Button,
Card,
Expand Down Expand Up @@ -35,7 +35,10 @@ interface PageProps {
}

export function generateMetadata({ params }: PageProps): Metadata {
const protocol = params.protocol as Protocol;
const protocol = params.protocol;
if (!isProtocol(protocol)) {
notFound();
}

return {
title: `stackspulse - ${protocolsInfo[protocol].name}`,
Expand Down

0 comments on commit 7a98647

Please sign in to comment.