Handles missing data keys safely

Uses `get` method to safely access optional entities in the data
dictionary, preventing potential KeyError when keys are absent.
This commit is contained in:
Jakub Jezek 2025-06-23 09:14:42 +02:00
parent b61d36867a
commit 8b98c56ee8
No known key found for this signature in database
GPG key ID: 06DBD609ADF27FD9

View file

@ -32,8 +32,8 @@ class GlobalHostDataHook(PreLaunchHook):
"app": app,
"project_entity": self.data["project_entity"],
"folder_entity": self.data["folder_entity"],
"task_entity": self.data["task_entity"],
"folder_entity": self.data.get("folder_entity"),
"task_entity": self.data.get("task_entity"),
"anatomy": self.data["anatomy"],