Fix TypeError due to race condition

This commit is contained in:
Calvin Montgomery 2014-07-20 19:36:29 -07:00
parent 79bb6a96cd
commit d9f5c551e3
1 changed files with 4 additions and 0 deletions

View File

@ -1012,6 +1012,10 @@ PlaylistModule.prototype.startPlayback = function (time) {
* Its purpose is to allow modification of playback data before
* users are sent a changeMedia
*/
if (!self.current || !self.current.media) {
return;
}
self.sendChangeMedia(self.channel.users);
self.channel.notifyModules("onMediaChange", [self.current.media]);