Skip to content

Commit

Permalink
Fixed NaN crashing the server.
Browse files Browse the repository at this point in the history
ajayyy committed Jul 26, 2019
1 parent abfbba2 commit 4379660
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -109,6 +109,12 @@ app.get('/api/postVideoSponsorTimes', function (req, res) {
startTime = parseFloat(startTime);
endTime = parseFloat(endTime);

if (startTime == NaN || endTime == NaN) {
//invalid request
res.sendStatus(400);
return;
}

if (startTime > endTime) {
//time can't go backwards
res.sendStatus(400);

0 comments on commit 4379660

Please sign in to comment.