diff --git a/src/server.ts b/src/server.ts index f862e27..df7303d 100644 --- a/src/server.ts +++ b/src/server.ts @@ -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