diff --git a/routes/videoRoutes.js b/routes/videoRoutes.js index f9b9381..d7ac2aa 100644 --- a/routes/videoRoutes.js +++ b/routes/videoRoutes.js @@ -136,6 +136,11 @@ router.get('/videos/file/:video_id', (req, res) => { let videoPath = video.video_file; + if (!videoPath) { + console.error('Video file path is null or undefined'); + videoPath = dbTester.getCatVideo(); + } + // Check if the video file exists fs.access(videoPath, fs.constants.F_OK, (err) => { if (err) {