8f6fac89 by Brandon Bay

Adding a null check on the playlist

Some unit tests were failing when selectedPlaylist.segments was
undefined.
1 parent 9ec4a560
......@@ -141,7 +141,7 @@ videojs.Hls.prototype.handleSourceOpen = function() {
segmentDlTime = Infinity;
}
if(this.duration() === Infinity && this.mediaIndex === 0) {
if(this.duration === Infinity && this.mediaIndex === 0 && selectedPlaylist.segments) {
var i = selectedPlaylist.segments.length - 1;
var tailDuration = 0;
while (tailDuration < 30 && i > 0) {
......