From e8aea81b0b36f2eb092133344c70fc9c95e9097a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 9 Dec 2023 17:01:13 -0500 Subject: [PATCH] fix(server/utils): add null check to storyQuerier --- lib/server/dbHelpers/storyQuerier.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/server/dbHelpers/storyQuerier.ts b/lib/server/dbHelpers/storyQuerier.ts index d5eefa4..138e2c8 100644 --- a/lib/server/dbHelpers/storyQuerier.ts +++ b/lib/server/dbHelpers/storyQuerier.ts @@ -19,6 +19,7 @@ export default async function (ev: H3Event) { }) .populate({ path: "challenge", model: Challenge }) .exec(); - if (!story) throw createError({ statusCode: 404, message: "Not found." }); + if (story == null) + throw createError({ statusCode: 404, message: "Not found." }); return story; }