From 40accd1c391639a6f1a73fd125af0f21816755fc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 12 Aug 2020 21:22:54 +0200 Subject: [PATCH] Make sure tools and applications attributes always have at least one item in to not raise an exception --- pype/modules/ftrack/actions/action_create_cust_attrs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pype/modules/ftrack/actions/action_create_cust_attrs.py b/pype/modules/ftrack/actions/action_create_cust_attrs.py index 0c7e311377..21c4743725 100644 --- a/pype/modules/ftrack/actions/action_create_cust_attrs.py +++ b/pype/modules/ftrack/actions/action_create_cust_attrs.py @@ -409,6 +409,10 @@ class CustomAttributes(BaseAction): )) ) ) + + # Make sure there is at least one item + if not app_definitions: + app_definitions.append({"empty": "< Empty >"}) return app_definitions def applications_attribute(self, event): @@ -432,6 +436,10 @@ class CustomAttributes(BaseAction): if usage: tools_data.append({tool_name: tool_name}) + # Make sure there is at least one item + if not tools_data: + tools_data.append({"empty": "< Empty >"}) + tools_custom_attr_data = { "label": "Tools", "key": "tools_env",