From 37afd141be3200dec79a9eed26172ff3eba0e5bb Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sun, 11 Mar 2018 20:59:18 -0700 Subject: [PATCH] Catch invalid json for custom conditions --- plexpy/notification_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 9230cb98..50d9765f 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -208,7 +208,10 @@ def notify_custom_conditions(notifier_id=None, parameters=None): notifier_config = notifiers.get_notifier_config(notifier_id=notifier_id) custom_conditions_logic = notifier_config['custom_conditions_logic'] - custom_conditions = json.loads(notifier_config['custom_conditions']) or [] + try: + custom_conditions = json.loads(notifier_config['custom_conditions']) or [] + except ValueError as e: + custom_conditions = [] if custom_conditions_logic or any(c for c in custom_conditions if c['value']): logger.debug(u"Tautulli NotificationHandler :: Checking custom notification conditions for notifier_id %s."