Fix npe when there are no segments in a video.

This commit is contained in:
Kavin 2023-02-10 08:56:50 +00:00 committed by GitHub
parent b3c242d08b
commit d3ef7e2b81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -383,7 +383,7 @@ export default {
});
const minSegmentLength = Math.max(this.getPreferenceNumber("minSegmentLength", 0), 0);
sponsors.segments = sponsors.segments.filter(segment => {
sponsors.segments = sponsors.segments?.filter(segment => {
const length = segment.segment[1] - segment.segment[0];
return length >= minSegmentLength;
});