From a0347ce03d072a3e098460299915b441e25139fe Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 19 Oct 2015 00:40:19 -0500 Subject: [PATCH] Fix error for playback report Take into account TypeError (nonetype), depending on the player used, it might not return a result. --- resources/lib/Player.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/lib/Player.py b/resources/lib/Player.py index 12d281a2..0b760a88 100644 --- a/resources/lib/Player.py +++ b/resources/lib/Player.py @@ -134,17 +134,17 @@ class Player( xbmc.Player ): try: # Audio tracks indexAudio = result['currentaudiostream']['index'] - except KeyError: + except (KeyError, TypeError): indexAudio = 0 try: # Subtitles tracks indexSubs = result['currentsubtitle']['index'] - except KeyError: + except (KeyError, TypeError): indexSubs = 0 try: # If subtitles are enabled subsEnabled = result['subtitleenabled'] - except KeyError: + except (KeyError, TypeError): subsEnabled = "" # Postdata for the audio @@ -276,17 +276,17 @@ class Player( xbmc.Player ): try: # Audio tracks indexAudio = result['currentaudiostream']['index'] - except KeyError: + except (KeyError, TypeError): indexAudio = 0 try: # Subtitles tracks indexSubs = result['currentsubtitle']['index'] - except KeyError: + except (KeyError, TypeError): indexSubs = 0 try: # If subtitles are enabled subsEnabled = result['subtitleenabled'] - except KeyError: + except (KeyError, TypeError): subsEnabled = "" # Postdata for the audio