From 4f15a6f07ef3abad386eb81db09c539e25011b70 Mon Sep 17 00:00:00 2001 From: josduj Date: Wed, 18 Jan 2017 10:26:14 +0100 Subject: [PATCH] Fixes error when scope is not set --- spotipy/oauth2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index 7574f88..fe9ae0d 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -149,8 +149,10 @@ class SpotifyOAuth(object): pass def _is_scope_subset(self, needle_scope, haystack_scope): - needle_scope = set(needle_scope.split()) - haystack_scope = set(haystack_scope.split()) + if needle_scope: + needle_scope = set(needle_scope.split()) + if haystack_scope: + haystack_scope = set(haystack_scope.split()) return needle_scope <= haystack_scope