From 192358dddb3bf2cf39ebe8dc8103146831f0c494 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 6 Jun 2025 16:02:09 +0200 Subject: [PATCH] Avoids OCIO env preparation without task entity Skips OCIO environment preparation when the task entity is not available in the hook data. This prevents potential errors or unexpected behavior when the hook is executed in contexts where task information is missing. --- client/ayon_core/hooks/pre_ocio_hook.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/ayon_core/hooks/pre_ocio_hook.py b/client/ayon_core/hooks/pre_ocio_hook.py index 9f5c8c7339..d1a02e613d 100644 --- a/client/ayon_core/hooks/pre_ocio_hook.py +++ b/client/ayon_core/hooks/pre_ocio_hook.py @@ -29,6 +29,15 @@ class OCIOEnvHook(PreLaunchHook): def execute(self): """Hook entry method.""" + task_entity = self.data.get("task_entity") + + if not task_entity: + self.log.info( + "Skipping OCIO Environment preparation." + "Task Entity is not available." + ) + return + folder_entity = self.data["folder_entity"] template_data = get_template_data(