Skip to content

Commit

Permalink
Merge pull request #84 from Carifio24/newest-only-undef-guard
Browse files Browse the repository at this point in the history
Add missing undefined guard
  • Loading branch information
Carifio24 authored Aug 15, 2023
2 parents 341f34b + f6896a4 commit 3842a7e
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 3842a7e

Please sign in to comment.