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.
This commit is contained in:
Jakub Jezek 2025-06-06 16:02:09 +02:00
parent 0bcc26dff4
commit 192358dddb
No known key found for this signature in database
GPG key ID: 06DBD609ADF27FD9

View file

@ -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(