mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 03:06:29 +00:00
Clean up Engine.GetGUIObjectByName calls
GetGUIObjectByName was previously made stricter, logging an error if it doesn't find the target object. This commit deals with the resulting error-causing (invalid) calls, by deleting them if they're unnecessary or converting them to the new TryGetGUIObjectByName (which doesn't log any errors).
This commit is contained in:
+1
-1
@@ -448,7 +448,7 @@ IGUIObject* CGUI::FindObjectByName(const CStr& Name) const
|
||||
{
|
||||
IGUIObject* obj = TryFindObjectByName(Name);
|
||||
if (obj == nullptr)
|
||||
LOGERROR("Failed to get GUI object by name: object '%s' not found.\nNote: Use 'Engine.TryGetGUIObjectByName' to query for potentially non-existent objects instead.", Name);
|
||||
LOGERROR("Failed to get GUI object by name: object '%s' not found. Note: Use 'Engine.TryGetGUIObjectByName' to query for potentially non-existent objects instead.", Name);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user