Skip to content

Commit

Permalink
[package] [a2dp-app-osmc] Guard for self.Player. It is initialised as…
Browse files Browse the repository at this point in the history
… none and will crash if invoked on

Signed-off-by: Sam Nazarko <email@samnazarko.co.uk>
  • Loading branch information
samnazarko committed Apr 3, 2017
1 parent 9019085 commit 062302f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,21 @@ def setBtPlayer(self, btPlayer):
self.btPlayer = btPlayer

def onPlayBackStopped(self):
if xbmc.isBTPlayerActive() and self.btPlayer.isPlaying():
if xbmc.isBTPlayerActive() and self.btPlayer.isPlaying() and self.btPlayer.player:
self.btPlayer.stop()

def onPlayBackPaused(self):
if xbmc.isBTPlayerActive() and self.btPlayer.isPlaying():
if xbmc.isBTPlayerActive() and self.btPlayer.isPlaying() and self.btPlayer.player:
self.btPlayer.pause()

def onPlayBackResumed(self):
if xbmc.isBTPlayerActive():
if xbmc.isBTPlayerActive() and self.btPlayer.player:
self.btPlayer.play()

def onNextItem(self):
if __addon__.getSetting("debug") == "true":
log("Next Item Event Fired")
if xbmc.isBTPlayerActive() and self.btPlayer.isPlaying():
if xbmc.isBTPlayerActive() and self.btPlayer.isPlaying() and self.btPlayer.player:
try:
self.btPlayer.next()
except Exception as e:
Expand All @@ -216,7 +216,7 @@ def onNextItem(self):
def onPreviousItem(self):
if __addon__.getSetting("debug") == "true":
log("Previous Item Event Fired")
if xbmc.isBTPlayerActive() and self.btPlayer.isPlaying():
if xbmc.isBTPlayerActive() and self.btPlayer.isPlaying() and self.btPlayer.player:
try:
self.btPlayer.previous()
except Exception as e:
Expand Down

0 comments on commit 062302f

Please sign in to comment.