From 405805ff891db1c91deb740d7a98b415a44f6aae Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 7 Nov 2024 02:24:39 -0500 Subject: [PATCH] Add check against missing api video detail failing to fetch --- src/routes/postSkipSegments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/postSkipSegments.ts b/src/routes/postSkipSegments.ts index 217be5c..b377e53 100644 --- a/src/routes/postSkipSegments.ts +++ b/src/routes/postSkipSegments.ts @@ -348,7 +348,7 @@ async function checkEachSegmentValid(rawIP: IPAddress, paramUserID: UserID, user async function checkByAutoModerator(videoID: VideoID, userID: HashedUserID, segments: IncomingSegment[], service: Service, apiVideoDetails: videoDetails, videoDuration: number): Promise { // Auto moderator check - if (service == Service.YouTube) { + if (service == Service.YouTube && apiVideoDetails) { const autoModerateResult = await autoModerateSubmission(apiVideoDetails, { videoID, userID, segments, service, videoDuration }); if (autoModerateResult) { return {