diff --git a/apps/web/src/components/layouts/poll-layout.tsx b/apps/web/src/components/layouts/poll-layout.tsx index 35aad1206..2ec41264f 100644 --- a/apps/web/src/components/layouts/poll-layout.tsx +++ b/apps/web/src/components/layouts/poll-layout.tsx @@ -287,6 +287,15 @@ const Prefetch = ({ children }: React.PropsWithChildren) => { }; const PollLayout = ({ children }: React.PropsWithChildren) => { + const router = useRouter(); + + const urlId = router.query.urlId as string; + + if (!urlId) { + // probably navigating away + return null; + } + return (