From c3e3b7c7ab0a5c4eacd81159da08f15109538f3d Mon Sep 17 00:00:00 2001 From: alexiscatnip Date: Wed, 20 Jul 2022 19:53:04 +0800 Subject: [PATCH] bugfix: #16 prevent UI resolves to NRE, during appli teardown with logout-event-being-raised-"too-late". --- Assets/Raindrop/Connectivity/connectivityUI.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/Raindrop/Connectivity/connectivityUI.cs b/Assets/Raindrop/Connectivity/connectivityUI.cs index 388e8f6..45188e3 100644 --- a/Assets/Raindrop/Connectivity/connectivityUI.cs +++ b/Assets/Raindrop/Connectivity/connectivityUI.cs @@ -65,11 +65,17 @@ public class connectivityUI : MonoBehaviour #region view private void show_notConnected() { - this.GetComponent().color = Color.red; + if (this != null) + { + this.GetComponent().color = Color.red; + } } private void show_isConnected() { - this.GetComponent().color = Color.green; + if (this != null) + { + this.GetComponent().color = Color.green; + } } #endregion }