Check for asrun() returning None

This commit is contained in:
ZyX 2014-02-03 21:23:42 +04:00
parent f26eb24e10
commit 5db02bba3a
1 changed files with 3 additions and 1 deletions

View File

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