From 35f7d320bd374805363cab3c16930da9a6ce3217 Mon Sep 17 00:00:00 2001 From: Thiago Menezes Date: Mon, 10 Jun 2024 16:02:54 -0300 Subject: [PATCH] fix: Possible null reference exception when setting transform position --- Basalt/Common/Components/Transform.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Basalt/Common/Components/Transform.cs b/Basalt/Common/Components/Transform.cs index f60505c..eb9dc20 100644 --- a/Basalt/Common/Components/Transform.cs +++ b/Basalt/Common/Components/Transform.cs @@ -28,7 +28,8 @@ public Vector3 Position return; } - Engine.Instance.EntityManager.ChunkingMechanism.MarkForUpdate(Entity); + if(Engine.Instance.EntityManager != null) + Engine.Instance.EntityManager.ChunkingMechanism.MarkForUpdate(Entity); var offset = value - position;