From 1094abce5a8ffe3f5bb88ab3a3864f820a29bd31 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 10 Jan 2024 12:12:11 +0100 Subject: [PATCH] Fix crash when finding actor or level with empty name text #2161 --- Source/Engine/Level/Actor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Level/Actor.cpp b/Source/Engine/Level/Actor.cpp index ff40cc208..7e2329389 100644 --- a/Source/Engine/Level/Actor.cpp +++ b/Source/Engine/Level/Actor.cpp @@ -1359,7 +1359,7 @@ bool Actor::IsPrefabRoot() const Actor* Actor::FindActor(const StringView& name) const { Actor* result = nullptr; - if (StringUtils::Compare(*_name, *name) == 0) + if (_name == name) { result = const_cast(this); } @@ -1393,7 +1393,7 @@ Actor* Actor::FindActor(const MClass* type) const Actor* Actor::FindActor(const MClass* type, const StringView& name) const { CHECK_RETURN(type, nullptr); - if (GetClass()->IsSubClassOf(type) && StringUtils::Compare(*_name, *name) == 0) + if (GetClass()->IsSubClassOf(type) && _name == name) return const_cast(this); for (auto child : Children) {