From a2432130a59fc9ea5da31b281d0e5d699a5e71a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Sat, 11 Jan 2025 17:39:08 +0100 Subject: [PATCH] Added a conditional check to avoid a fatal error when the input JSON is missing a `categories` prop --- scripts/add_new_contribution_to_yaml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/add_new_contribution_to_yaml.py b/scripts/add_new_contribution_to_yaml.py index 18812a7..026212e 100644 --- a/scripts/add_new_contribution_to_yaml.py +++ b/scripts/add_new_contribution_to_yaml.py @@ -15,7 +15,7 @@ props = json.loads(argv[1]) # process category list - if props['categories']: + if 'categories' in props and props['categories']: props['categories'] = sorted(props['categories'].replace('"', '').split(',')) props['categories'] = [category.strip() for category in props['categories']] else: