From 793bb502f55c82767cd4914c9a330aeb63c334e9 Mon Sep 17 00:00:00 2001 From: Wojciech Figat Date: Mon, 13 Dec 2021 17:30:03 +0100 Subject: [PATCH] Fix prefab changes apply crash #305 --- Source/Engine/Level/Prefabs/Prefab.Apply.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/Level/Prefabs/Prefab.Apply.cpp b/Source/Engine/Level/Prefabs/Prefab.Apply.cpp index b960ce7cf..a0c20a221 100644 --- a/Source/Engine/Level/Prefabs/Prefab.Apply.cpp +++ b/Source/Engine/Level/Prefabs/Prefab.Apply.cpp @@ -974,7 +974,7 @@ bool Prefab::ApplyAllInternal(Actor* targetActor, bool linkTargetActorObjectToPr { // When changing prefab root the target actor is a new root so try to find it in the objects int32 targetActorIdx = oldObjectsIds.Find(targetActor->GetPrefabObjectID()); - if (targetActorIdx > 0 && dynamic_cast(sceneObjects.Value->At(targetActorIdx))) + if (targetActorIdx > 0 && targetActorIdx < sceneObjects.Value->Count() && dynamic_cast(sceneObjects.Value->At(targetActorIdx))) { root = dynamic_cast(sceneObjects.Value->At(targetActorIdx)); }