Skip to content

Commit

Permalink
Add a missing undefined guard
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 authored Aug 15, 2023
1 parent 341f34b commit f6896a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ app.post("/question/:tag", async (req, res) => {
app.get("/questions/:storyName", async (req, res) => {
const storyName = req.params.storyName;
const newestOnlyString = req.query.newest_only as string;
const newestOnly = newestOnlyString.toLowerCase() !== "false";
const newestOnly = newestOnlyString?.toLowerCase() !== "false";
const questions = await getQuestionsForStory(storyName, newestOnly);
res.json({
questions
Expand Down

0 comments on commit f6896a4

Please sign in to comment.