From 07fc2fb7249ff71ef008b45ff86be9b78434e465 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 5 Nov 2021 12:44:01 +0100 Subject: [PATCH] Fix errore jsontools --- core/item.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/item.py b/core/item.py index ec8716d8..4614ad58 100644 --- a/core/item.py +++ b/core/item.py @@ -364,14 +364,15 @@ class Item(object): if "?" in url: url = url.split("?")[1] decoded = False - try: - str_item = base64.b64decode(urllib.unquote(url)) - json_item = json.load(str_item, object_hook=self.toutf8) - if json_item is not None and len(json_item) > 0: - self.__dict__.update(json_item) - decoded = True - except: - pass + if url: + try: + str_item = base64.b64decode(urllib.unquote(url)) + json_item = json.load(str_item, object_hook=self.toutf8) + if json_item is not None and len(json_item) > 0: + self.__dict__.update(json_item) + decoded = True + except: + pass if not decoded: url = urllib.unquote_plus(url)