From 77894ea1fe893e7fb32e4fd2b32724fa6431985f Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Mon, 6 Sep 2021 17:31:42 +0300 Subject: [PATCH] Add try --- image_classifier/image_classifier.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/image_classifier/image_classifier.py b/image_classifier/image_classifier.py index 1e53b85..8b8320c 100755 --- a/image_classifier/image_classifier.py +++ b/image_classifier/image_classifier.py @@ -101,7 +101,10 @@ class image_classifier: self.exif_info.set("user_comment", json.dumps(data)) def is_json(self, data): - result = json.loads(data) + try: + result = json.loads(data) + except TypeError: + return False return True def load_known_people(self):