From 5db02bba3a6865a2b5c92071fdb54ca1b846a146 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 3 Feb 2014 21:23:42 +0400 Subject: [PATCH] Check for asrun() returning None --- powerline/segments/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/powerline/segments/common.py b/powerline/segments/common.py index c47d04d9..cbc8e0be 100644 --- a/powerline/segments/common.py +++ b/powerline/segments/common.py @@ -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),