From a02761221689d113a52328f6c231ae297004e175 Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Mon, 10 Jul 2023 15:34:06 -0400 Subject: [PATCH] error handling --- beetsplug/deezer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/beetsplug/deezer.py b/beetsplug/deezer.py index 55f14dc6b..8f7e6fda9 100644 --- a/beetsplug/deezer.py +++ b/beetsplug/deezer.py @@ -76,7 +76,11 @@ class DeezerPlugin(MetadataSourcePlugin, BeetsPlugin): return None album_data = requests.get(self.album_url + deezer_id).json() - artist, artist_id = self.get_artist(album_data.get('contributors')) + contributors = album_data.get('contributors') + if contributors is not None: + artist, artist_id = self.get_artist(contributors) + else: + artist, artist_id = None, None release_date = album_data['release_date'] date_parts = [int(part) for part in release_date.split('-')]