Skip to content

Commit

Permalink
avoid error Cannot read property 'urlId' of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Lekh authored and mangui committed Apr 3, 2017
1 parent f9bb6b9 commit 445b3e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/controller/level-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,11 @@ class LevelController extends EventHandler {
tick() {
var levelId = this._level;
if (levelId !== undefined && this.canload) {
var level = this._levels[levelId], urlId = level.urlId;
this.hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: levelId, id: urlId});
var level = this._levels[levelId];
if (level && level.url) {
var urlId = level.urlId;
this.hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: levelId, id: urlId});
}
}
}

Expand Down

0 comments on commit 445b3e4

Please sign in to comment.