Skip to content

Commit

Permalink
Fix 404 on invalid page id
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunkomath committed Feb 12, 2024
1 parent 13e7f20 commit d9b902a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/web/pages/pages/[page_id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export async function getServerSideProps({ req, res, params }) {
const { page_id } = params;

const { user, supabase } = await getSupabaseServerClient({ req, res });
const page = await getPage(supabase, page_id);
const page = await getPage(supabase, page_id).catch((e) => {
console.error("Failed to get page", e);
return null;
});

if (!page) {
return {
Expand Down

0 comments on commit d9b902a

Please sign in to comment.