From 1862517c0ff9005cdb86dee5fff0474b1079afc4 Mon Sep 17 00:00:00 2001 From: huyufei Date: Fri, 17 May 2024 13:14:16 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=AE=8C=E5=96=84=20I=1DsIAPUser=20?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huyufei --- Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs index 07f359e..91aa81c 100644 --- a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs +++ b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs @@ -35,7 +35,7 @@ namespace Guru private Dictionary _products; protected Dictionary Products => _products; - public bool IsInitialized => _storeController != null && _storeExtensionProvider != null; + public bool IsInitialized => _storeController != null && _storeExtensionProvider != null && _model != null; private ProductInfo _curProductInfo = null; private string _curProductCategory = ""; @@ -881,7 +881,10 @@ namespace Guru /// public static void SetIsIAPUser(bool value = true) { - Instance._model.SetIsIapUser(value); // 用户属性 + if (Instance != null && Instance._model != null) + { + Instance._model.SetIsIapUser(value); // 用户属性 + } Analytics.SetUserProperty(Analytics.PropertyIsIAPUser, value ? "true" : "false"); }