From 596b61b23f9c44103814e9eddd1bb7ca595a38d7 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 18 Sep 2024 23:36:27 +0200 Subject: [PATCH] Fix crashes in vector editors in rare cases --- Source/Editor/CustomEditors/Editors/Vector2Editor.cs | 6 +++--- Source/Editor/CustomEditors/Editors/Vector3Editor.cs | 6 +++--- Source/Editor/CustomEditors/Editors/Vector4Editor.cs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Editor/CustomEditors/Editors/Vector2Editor.cs b/Source/Editor/CustomEditors/Editors/Vector2Editor.cs index f7efea223..032a237a8 100644 --- a/Source/Editor/CustomEditors/Editors/Vector2Editor.cs +++ b/Source/Editor/CustomEditors/Editors/Vector2Editor.cs @@ -69,7 +69,7 @@ namespace FlaxEditor.CustomEditors.Editors private void OnValueChanged() { - if (IsSetBlocked) + if (IsSetBlocked || Values == null) return; var isSliding = XElement.IsSliding || YElement.IsSliding; @@ -158,7 +158,7 @@ namespace FlaxEditor.CustomEditors.Editors private void OnValueChanged() { - if (IsSetBlocked) + if (IsSetBlocked || Values == null) return; var isSliding = XElement.IsSliding || YElement.IsSliding; @@ -247,7 +247,7 @@ namespace FlaxEditor.CustomEditors.Editors private void OnValueChanged() { - if (IsSetBlocked) + if (IsSetBlocked || Values == null) return; var isSliding = XElement.IsSliding || YElement.IsSliding; diff --git a/Source/Editor/CustomEditors/Editors/Vector3Editor.cs b/Source/Editor/CustomEditors/Editors/Vector3Editor.cs index 719fbf05d..80fe7e205 100644 --- a/Source/Editor/CustomEditors/Editors/Vector3Editor.cs +++ b/Source/Editor/CustomEditors/Editors/Vector3Editor.cs @@ -143,7 +143,7 @@ namespace FlaxEditor.CustomEditors.Editors private void OnValueChanged() { - if (IsSetBlocked) + if (IsSetBlocked || Values == null) return; var xValue = XElement.ValueBox.Value; @@ -318,7 +318,7 @@ namespace FlaxEditor.CustomEditors.Editors private void OnValueChanged() { - if (IsSetBlocked) + if (IsSetBlocked || Values == null) return; var isSliding = XElement.IsSliding || YElement.IsSliding || ZElement.IsSliding; @@ -418,7 +418,7 @@ namespace FlaxEditor.CustomEditors.Editors private void OnValueChanged() { - if (IsSetBlocked) + if (IsSetBlocked || Values == null) return; var isSliding = XElement.IsSliding || YElement.IsSliding || ZElement.IsSliding; diff --git a/Source/Editor/CustomEditors/Editors/Vector4Editor.cs b/Source/Editor/CustomEditors/Editors/Vector4Editor.cs index 9f8514bc4..6b953ddd8 100644 --- a/Source/Editor/CustomEditors/Editors/Vector4Editor.cs +++ b/Source/Editor/CustomEditors/Editors/Vector4Editor.cs @@ -89,7 +89,7 @@ namespace FlaxEditor.CustomEditors.Editors private void OnValueChanged() { - if (IsSetBlocked) + if (IsSetBlocked || Values == null) return; var isSliding = XElement.IsSliding || YElement.IsSliding || ZElement.IsSliding || WElement.IsSliding; @@ -200,7 +200,7 @@ namespace FlaxEditor.CustomEditors.Editors private void OnValueChanged() { - if (IsSetBlocked) + if (IsSetBlocked || Values == null) return; var isSliding = XElement.IsSliding || YElement.IsSliding || ZElement.IsSliding || WElement.IsSliding; @@ -311,7 +311,7 @@ namespace FlaxEditor.CustomEditors.Editors private void OnValueChanged() { - if (IsSetBlocked) + if (IsSetBlocked || Values == null) return; var isSliding = XElement.IsSliding || YElement.IsSliding || ZElement.IsSliding || WElement.IsSliding;