From 06de0d61fa360e686f00b78e25b073f201335ca4 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Mon, 6 Apr 2020 20:14:50 -0400 Subject: [PATCH] Fixed crashes from multiple submissions. --- src/routes/postSkipSegments.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/postSkipSegments.js b/src/routes/postSkipSegments.js index afa26f5..795796f 100644 --- a/src/routes/postSkipSegments.js +++ b/src/routes/postSkipSegments.js @@ -243,8 +243,6 @@ module.exports = async function postSkipSegments(req, res) { //add to private db as well privateDB.prepare("INSERT INTO sponsorTimes VALUES(?, ?, ?)").run(videoID, hashedIP, timeSubmitted); - - res.sendStatus(200); } catch (err) { //a DB change probably occurred res.sendStatus(502); @@ -261,5 +259,9 @@ module.exports = async function postSkipSegments(req, res) { console.error(err); res.sendStatus(500); + + return; } + + res.sendStatus(200); }