From 1f2c251d0ca206c22be8c286d79bdf5cbbd09b7e Mon Sep 17 00:00:00 2001 From: Hubert Mattusch Date: Thu, 1 Jun 2023 00:25:38 +0200 Subject: [PATCH] popups fix --- NEG/UI/UiManager.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/NEG/UI/UiManager.cs b/NEG/UI/UiManager.cs index 0300324..c54c6df 100644 --- a/NEG/UI/UiManager.cs +++ b/NEG/UI/UiManager.cs @@ -135,7 +135,7 @@ namespace NEG.UI { if (currentShownPopup.data != data) { - Debug.LogError("Popup was not shown"); + //Debug.LogError("Popup was not shown"); return; } UpdatePopupsState(false); @@ -163,7 +163,10 @@ namespace NEG.UI return; } - currentShownPopup.data?.Hide(); + if (currentShownPopup.data == null) + return; + currentShownPopup.data.PopupClosedEvent -= PopupClosed; + currentShownPopup.data.Hide(); currentShownPopup.data = null; }