From 67c38039b0b7abce434ab2800e86f932a6c0489a Mon Sep 17 00:00:00 2001 From: Tzahi12345 Date: Thu, 30 Nov 2023 00:30:07 -0500 Subject: [PATCH] Fixed issue where missing video file would cause exception to be thrown when watching/previewing --- backend/app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/app.js b/backend/app.js index e183a0c..b48262b 100644 --- a/backend/app.js +++ b/backend/app.js @@ -1650,6 +1650,7 @@ app.get('/api/stream', optionalJwt, async (req, res) => { } if (!fs.existsSync(file_path)) { logger.error(`File ${file_path} could not be found! UID: ${uid}, ID: ${file_obj && file_obj.id}`); + return; } const stat = fs.statSync(file_path); const fileSize = stat.size;