From 6b02f619ceb8f0e8b9a124d403b8b116d9f8b1fb Mon Sep 17 00:00:00 2001 From: huyufei Date: Mon, 29 Jul 2024 20:03:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Guru.AdStatusPresen?= =?UTF-8?q?ter.CreateMonitorInfo=20=E6=8A=A5=E7=A9=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NullReferenceException: Object reference not set to an instance of an object. Guru.AdStatusPresenter.CreateMonitorInfo Signed-off-by: huyufei --- .../Runtime/AdsStatus/MVP/AdStatusPresenter.Ads.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Runtime/GuruDebugger/Runtime/AdsStatus/MVP/AdStatusPresenter.Ads.cs b/Runtime/GuruDebugger/Runtime/AdsStatus/MVP/AdStatusPresenter.Ads.cs index 2f74917..2ecafe9 100644 --- a/Runtime/GuruDebugger/Runtime/AdsStatus/MVP/AdStatusPresenter.Ads.cs +++ b/Runtime/GuruDebugger/Runtime/AdsStatus/MVP/AdStatusPresenter.Ads.cs @@ -65,6 +65,7 @@ namespace Guru private void OnStatueChanged(AdStatusInfo info) { + if (_model == null) return; _model.monitorInfo = CreateMonitorInfo(); if (info != null) @@ -106,7 +107,7 @@ namespace Guru string msg = ""; bool loaded = false; - if (!ADService.Instance.IsInitialized) + if (ADService.Instance == null || !ADService.Instance.IsInitialized) { msg = ColoredText("AdService not initialized...", Consts.ColorRed); return msg;