Skip to content

Commit

Permalink
Check position against null, not zero
Browse files Browse the repository at this point in the history
a8ac314 had a bug in which a switch at position zero would not result
in clearing anything.  Positions may validly be zero, but never null.

Change-Id: I95a607df7bd6a41cf73f78122c3dcdda425fb145
  • Loading branch information
joeyparrish committed Sep 29, 2016
1 parent 7f7e6d7 commit 4593cf7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,14 @@ shaka.media.StreamingEngine.prototype.clear_ = function(mediaState, clear) {

goog.asserts.assert(position != null,
'No segment under the playhead! This should not happen!');
if (!position) {
if (position == null) {
return;
}

var reference = mediaState.stream.getSegmentReference(position);
goog.asserts.assert(reference != null,
'No reference for current position! This should not happen!');
if (!reference) {
if (reference == null) {
return;
}

Expand Down

0 comments on commit 4593cf7

Please sign in to comment.