Skip to content

Commit

Permalink
Streamline checking for variable validity and type
Browse files Browse the repository at this point in the history
  • Loading branch information
confused-Techie committed Dec 18, 2023
1 parent beceefc commit 31b4bbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const reg = require("./reg.js");

async function displayError(req, res, details) {
console.error(details);
if (details?.status_to_display && typeof details.status_to_display === "number") {
if (typeof details?.status_to_display === "number") {
res.status(details.status_to_display).render("error", details);
} else {
res.status(500).render("error", details);
Expand Down

0 comments on commit 31b4bbb

Please sign in to comment.