fix(server/utils): add null check to storyQuerier
This commit is contained in:
parent
46c9a07b7d
commit
e8aea81b0b
@ -19,6 +19,7 @@ export default async function (ev: H3Event<EventHandlerRequest>) {
|
|||||||
})
|
})
|
||||||
.populate({ path: "challenge", model: Challenge })
|
.populate({ path: "challenge", model: Challenge })
|
||||||
.exec();
|
.exec();
|
||||||
if (!story) throw createError({ statusCode: 404, message: "Not found." });
|
if (story == null)
|
||||||
|
throw createError({ statusCode: 404, message: "Not found." });
|
||||||
return story;
|
return story;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user