From d9f5c551e30fa0f7a4416b594ece69be6c420f0f Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sun, 20 Jul 2014 19:36:29 -0700 Subject: [PATCH] Fix TypeError due to race condition --- lib/channel/playlist.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/channel/playlist.js b/lib/channel/playlist.js index 0c05a53e..d4173f12 100644 --- a/lib/channel/playlist.js +++ b/lib/channel/playlist.js @@ -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]);