From 1818d99caf07435b11c3672a51535b117976cf1f Mon Sep 17 00:00:00 2001 From: BitterSmile Date: Tue, 6 Feb 2024 18:07:28 +0100 Subject: [PATCH] null fix --- NEG/UI/UnityUi/MonoUiManager.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NEG/UI/UnityUi/MonoUiManager.cs b/NEG/UI/UnityUi/MonoUiManager.cs index 7db2fb4..dbafda8 100644 --- a/NEG/UI/UnityUi/MonoUiManager.cs +++ b/NEG/UI/UnityUi/MonoUiManager.cs @@ -75,8 +75,11 @@ namespace NEG.UI.UnityUi base.UpdatePopupsState(forceShow, priority, data); if(inputModule.CurrentSelectionSource != SelectionSource.Direction) return; - if (CurrentPopup == null && (EventSystem.current.currentSelectedGameObject != null || !EventSystem.current.currentSelectedGameObject.activeInHierarchy)) + + if (CurrentPopup == null && (EventSystem.current.currentSelectedGameObject == null || !EventSystem.current.currentSelectedGameObject.activeInHierarchy)) { + if(((MonoWindow)CurrentMainWindow).DefaultSelectedItem == null) + return; EventSystem.current.SetSelectedGameObject(((MonoWindow)CurrentMainWindow).DefaultSelectedItem); } }