From de626f5cd9f00ad1b1a7983d6dbc2d11fa2868ca Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 17 Jun 2018 12:35:09 +0200 Subject: [PATCH] Fix KeyError on non-PKC playback startup --- resources/lib/kodimonitor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 491400d1..12a329bf 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -312,7 +312,11 @@ class KodiMonitor(xbmc.Monitor): # element otherwise self._already_slept = True xbmc.sleep(1000) - json_item = js.get_item(playerid) + try: + json_item = js.get_item(playerid) + except KeyError: + LOG.debug('No playing item returned by Kodi') + return None, None, None LOG.debug('Kodi playing item properties: %s', json_item) return (json_item.get('id'), json_item.get('type'),