From 03c0d100140b214458077aa50cc9ca10cde705d7 Mon Sep 17 00:00:00 2001 From: Diren D Bharwani Date: Sun, 30 Oct 2022 15:10:39 +0800 Subject: [PATCH] Fixed bug where objects without transform causes a crash on reparenting --- SHADE_Engine/src/Math/Transform/SHTransformSystem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SHADE_Engine/src/Math/Transform/SHTransformSystem.cpp b/SHADE_Engine/src/Math/Transform/SHTransformSystem.cpp index a2ab6880..c90e4431 100644 --- a/SHADE_Engine/src/Math/Transform/SHTransformSystem.cpp +++ b/SHADE_Engine/src/Math/Transform/SHTransformSystem.cpp @@ -263,6 +263,9 @@ namespace SHADE auto* node = EVENT_DATA->data->node; auto* tf = SHComponentManager::GetComponent_s(node->GetEntityID()); + if (tf == nullptr) + return EVENT_DATA->handle; + // Recompute local transform and store localToWorld Matrix SHMatrix localToWorld = SHMatrix::Identity; SHMatrix worldToLocal = SHMatrix::Identity;