Skip to content

Commit

Permalink
Merge pull request #7 from ajayyy/experimental
Browse files Browse the repository at this point in the history
Fixed NaN crashing the server
  • Loading branch information
ajayyy authored Jul 26, 2019
2 parents 51efb9a + 4379660 commit 1148803
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
Expand Up @@ -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);
Expand Down

0 comments on commit 1148803

Please sign in to comment.