diff --git a/src/pages/beers/styles/[id]/index.tsx b/src/pages/beers/styles/[id]/index.tsx index 6a18f6d..f022d32 100644 --- a/src/pages/beers/styles/[id]/index.tsx +++ b/src/pages/beers/styles/[id]/index.tsx @@ -65,6 +65,9 @@ export default BeerStyleByIdPage; export const getServerSideProps: GetServerSideProps = async ({ params }) => { const id = params!.id as string; const beerStyle = await getBeerStyleById(id); + if (!beerStyle) { + return { notFound: true }; + } return { props: { beerStyle: JSON.parse(JSON.stringify(beerStyle)) } }; };