fix(server/utils): add null check to storyQuerier

This commit is contained in:
parent 46c9a07b7d
commit e8aea81b0b
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -19,6 +19,7 @@ export default async function (ev: H3Event<EventHandlerRequest>) {
})
.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;
}