From 99c26ff9af0476a974d68f53d39a08dd598e4e67 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 21 Oct 2025 15:54:37 +0200 Subject: [PATCH] Fix crash when control reference gets invalid in Editor --- Source/Engine/UI/UIControl.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Engine/UI/UIControl.cs b/Source/Engine/UI/UIControl.cs index 89563a21a..75569ebcc 100644 --- a/Source/Engine/UI/UIControl.cs +++ b/Source/Engine/UI/UIControl.cs @@ -299,6 +299,8 @@ namespace FlaxEngine private void OnControlLocationChanged(Control control) { + if (control == null || !this) + return; _blockEvents = true; LocalPosition = new Vector3(control.Location, LocalPosition.Z); _blockEvents = false;