Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix 404 error on invite page (#898)

Luke Vellae85045a56279
diff --git a/apps/web/src/pages/invite/[urlId].tsx b/apps/web/src/pages/invite/[urlId].tsx
index 838e7eb93..9e4336771 100644
--- a/apps/web/src/pages/invite/[urlId].tsx
+++ b/apps/web/src/pages/invite/[urlId].tsx
@@ -184,7 +184,7 @@ export const getStaticPaths = async () => {
export const getStaticProps: GetStaticProps = async (ctx) => {
// We get these props to be able to render the og:image
- const poll = await prisma.poll.findUniqueOrThrow({
+ const poll = await prisma.poll.findUnique({
where: {
id: ctx.params?.urlId as string,
},
@@ -199,6 +199,10 @@ export const getStaticProps: GetStaticProps = async (ctx) => {
},
});
+ if (!poll) {
+ return { props: {}, notFound: 404 };
+ }
+
const res = await getStaticTranslations(ctx);
if ("props" in res) {