Handle empty playlists as invalid

This commit is contained in:
0xboobface 2018-08-16 13:39:55 +02:00
parent 998795d629
commit d7a9e22bc3
1 changed files with 3 additions and 1 deletions

View File

@ -188,7 +188,9 @@ public class PlaylistGenerator {
return name.startsWith("media_") && name.endsWith(".ts");
}
});
if(segments.length != playlistSize) {
if(segments.length == 0) {
throw new InvalidPlaylistException("No segments found. Playlist is empty");
} else if(segments.length != playlistSize) {
throw new InvalidPlaylistException("Playlist size and amount of segments differ");
} else {
LOG.debug("Generated playlist looks good");