Check for asrun() returning None

This commit is contained in:
ZyX 2014-02-03 21:23:42 +04:00
parent f26eb24e10
commit 5db02bba3a

View File

@ -1032,11 +1032,13 @@ class NowPlayingSegment(object):
''' '''
spotify = asrun(pl, ascript) spotify = asrun(pl, ascript)
if not asrun:
return None
spotify_status = spotify.split(", ") spotify_status = spotify.split(", ")
state = self._convert_state(spotify_status[0]) state = self._convert_state(spotify_status[0])
if state == 'stop': if state == 'stop':
return return None
return { return {
'state': state, 'state': state,
'state_symbol': self.STATE_SYMBOLS.get(state), 'state_symbol': self.STATE_SYMBOLS.get(state),