From 0d4962ad83dbed42482cf218403e62ef1dc87f83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Sun, 19 Apr 2020 13:08:00 +0200 Subject: [PATCH] sys.argv[1:] is not available in all addon threads --- jellyfin_kodi/entrypoint/default.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jellyfin_kodi/entrypoint/default.py b/jellyfin_kodi/entrypoint/default.py index 9fa936f2..eab81ff3 100644 --- a/jellyfin_kodi/entrypoint/default.py +++ b/jellyfin_kodi/entrypoint/default.py @@ -23,8 +23,11 @@ from helper import LazyLogger LOG = LazyLogger(__name__) ADDON_BASE_URL = sys.argv[0] -PROCESS_HANDLE = int(sys.argv[1]) -QUERY_STRING = sys.argv[2] +try: + PROCESS_HANDLE = int(sys.argv[1]) + QUERY_STRING = sys.argv[2] +except IndexError: + pass #################################################################################################