From 1207ab485cf4b4761900808188f68885f3b9c7c3 Mon Sep 17 00:00:00 2001 From: croneter Date: Thu, 17 Dec 2020 17:33:55 +0100 Subject: [PATCH] Fix rare KeyError: None when trying to sync the playlist --- resources/lib/playlists/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/lib/playlists/__init__.py b/resources/lib/playlists/__init__.py index 1e2ff6bc..5e612a4c 100644 --- a/resources/lib/playlists/__init__.py +++ b/resources/lib/playlists/__init__.py @@ -357,6 +357,10 @@ def sync_plex_playlist(playlist=None, xml=None, plex_id=None): if api.playlist_type() == v.PLEX_TYPE_PHOTO_PLAYLIST: # Not supported by Kodi return False + elif api.playlist_type() is None: + # Encountered in logs, seems to be a malformed answer + LOG.error('Playlist type is missing: %s', api.xml.attrib) + return False name = api.title() typus = v.KODI_PLAYLIST_TYPE_FROM_PLEX[api.playlist_type()] if (not app.SYNC.enable_music and typus == v.PLEX_PLAYLIST_TYPE_AUDIO):