From 379694ac4eaec0000fae7b6cff994f91d78620ce Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 12 Feb 2010 22:47:23 +0100 Subject: [PATCH] despotify: search() should always return a Playlist --- mopidy/backends/despotify.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mopidy/backends/despotify.py b/mopidy/backends/despotify.py index 85f5abee..dc786d64 100644 --- a/mopidy/backends/despotify.py +++ b/mopidy/backends/despotify.py @@ -38,8 +38,9 @@ class DespotifyLibraryController(BaseLibraryController): def search(self, type, what): query = u'%s:%s' % (type, what) result = self.backend.spotify.search(query.encode(ENCODING)) - if result is not None: - return self.backend.translate.to_mopidy_playlist(result.playlist) + if result is None: + return Playlist() + return self.backend.translate.to_mopidy_playlist(result.playlist) class DespotifyPlaybackController(BasePlaybackController):