Prevent failing on api errors

This commit is contained in:
Ajay Ramachandran
2021-06-03 11:29:55 -04:00
parent 10fcc7885f
commit 1e5849f504
3 changed files with 5 additions and 7 deletions

View File

@@ -212,7 +212,7 @@ async function autoModerateSubmission(apiVideoInfo: APIVideoInfo,
return a[0] - b[0] || a[1] - b[1];
}));
const videoDuration = data.lengthSeconds;
const videoDuration = data?.lengthSeconds;
if (videoDuration != 0) {
let allSegmentDuration = 0;
//sum all segment times together