From cd162f25d2c168d29f41bef4b9c99cb6fdfbac0a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 29 Jul 2021 17:18:09 +0200 Subject: Fix video format utils --- server/models/video/formatter/video-format-utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/models') diff --git a/server/models/video/formatter/video-format-utils.ts b/server/models/video/formatter/video-format-utils.ts index 6b1e59063..ab4cf53a8 100644 --- a/server/models/video/formatter/video-format-utils.ts +++ b/server/models/video/formatter/video-format-utils.ts @@ -205,7 +205,7 @@ function videoFilesModelToFormattedJSON ( ? video.getTrackerUrls() : [] - return [ ...videoFiles ] + return (videoFiles || []) .filter(f => !f.isLive()) .sort(sortByResolutionDesc) .map(videoFile => { @@ -240,7 +240,7 @@ function addVideoFilesInAPAcc ( ) { const trackerUrls = video.getTrackerUrls() - const sortedFiles = [ ...files ] + const sortedFiles = (files || []) .filter(f => !f.isLive()) .sort(sortByResolutionDesc) -- cgit v1.2.3