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() { ...@@ -141,7 +141,7 @@ videojs.Hls.prototype.handleSourceOpen = function() {
141 segmentDlTime = Infinity; 141 segmentDlTime = Infinity;
142 } 142 }
143 143
144 if(this.duration() === Infinity && this.mediaIndex === 0) { 144 if(this.duration === Infinity && this.mediaIndex === 0 && selectedPlaylist.segments) {
145 var i = selectedPlaylist.segments.length - 1; 145 var i = selectedPlaylist.segments.length - 1;
146 var tailDuration = 0; 146 var tailDuration = 0;
147 while (tailDuration < 30 && i > 0) { 147 while (tailDuration < 30 && i > 0) {
......