Skip to content

Commit

Permalink
playlist-loader: Make sure we don't try to access a destroyed loader
Browse files Browse the repository at this point in the history
  • Loading branch information
nhjm449 committed Mar 4, 2016
1 parent 688cec5 commit 8225216
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/loader/playlist-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ class PlaylistLoader extends EventHandler {
details = ErrorDetails.LEVEL_LOAD_ERROR;
fatal = false;
}
this.loader.abort();
if (this.loader) {
this.loader.abort();
}
this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: this.url, loader: this.loader, response: event.currentTarget, level: this.id, id: this.id2});
}

Expand All @@ -278,8 +280,10 @@ class PlaylistLoader extends EventHandler {
details = ErrorDetails.LEVEL_LOAD_TIMEOUT;
fatal = false;
}
this.loader.abort();
this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: this.url, loader: this.loader, level: this.id, id: this.id2});
if (this.loader) {
this.loader.abort();
}
this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: this.url, loader: this.loader, level: this.id, id: this.id2});
}
}

Expand Down

0 comments on commit 8225216

Please sign in to comment.