From 71857cc04bfb7529592d0b629f9e02597b826d3d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 31 Jul 2024 08:55:56 +0200 Subject: [PATCH] More robust doesVideoExistForVideoFile --- server/core/models/video/video-file.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/core/models/video/video-file.ts b/server/core/models/video/video-file.ts index b44d56940..a26269451 100644 --- a/server/core/models/video/video-file.ts +++ b/server/core/models/video/video-file.ts @@ -352,6 +352,8 @@ export class VideoFileModel extends SequelizeModel { return VideoFileModel.scope({ method: [ ScopeNames.WITH_VIDEO_OR_PLAYLIST, whereVideo ] }) .findOne(options) .then(file => { + if (!file) return null + // We used `required: false` so check we have at least a video or a streaming playlist if (!file.Video && !file.VideoStreamingPlaylist) return null