Skip to content

Commit

Permalink
fix(analytics): check typeof status before sending
Browse files Browse the repository at this point in the history
  • Loading branch information
ishan-chhabra committed Aug 12, 2020
1 parent 6323805 commit 965a298
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/routes/analytics-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ router.get(
return res.status(200).json(data);
} catch (error) {
console.log(error);
return res.status(error).send();
if (typeof error === "number") {
return res.status(error).send();
}
return res.status(500).send();
}
}
);
Expand Down

0 comments on commit 965a298

Please sign in to comment.