diff --git a/GooglePlayPlugins/com.google.play.billing/Runtime/Scripts/GooglePlayStoreImpl.cs b/GooglePlayPlugins/com.google.play.billing/Runtime/Scripts/GooglePlayStoreImpl.cs index e8f4b40e..51abcff9 100644 --- a/GooglePlayPlugins/com.google.play.billing/Runtime/Scripts/GooglePlayStoreImpl.cs +++ b/GooglePlayPlugins/com.google.play.billing/Runtime/Scripts/GooglePlayStoreImpl.cs @@ -566,7 +566,13 @@ private void ParsePurchaseResult(AndroidJavaObject billingResult, AndroidJavaObj var debugMessage = JniUtils.GetDebugMessageFromBillingResult(billingResult); if (responseCode == BillingResponseCode.Ok) { - var purchasesList = _jniUtils.ParseJavaPurchaseList(javaPurchasesList); + var purchasesList = _jniUtils.ParseJavaPurchaseList(javaPurchasesList).ToList(); + if (purchasesList.Count == 0) + { + _productInPurchaseFlow = null; + return; + } + _inventory.UpdatePurchaseInventory(purchasesList); // Unity IAP only supports one purchase at a time. Purchase purchase = purchasesList.First(); diff --git a/GooglePlayPlugins/com.google.play.billing/Runtime/Scripts/Internal/JniUtils.cs b/GooglePlayPlugins/com.google.play.billing/Runtime/Scripts/Internal/JniUtils.cs index b864e651..d1b081bd 100644 --- a/GooglePlayPlugins/com.google.play.billing/Runtime/Scripts/Internal/JniUtils.cs +++ b/GooglePlayPlugins/com.google.play.billing/Runtime/Scripts/Internal/JniUtils.cs @@ -174,6 +174,11 @@ public IEnumerable ParseQueryPurchasesResult(AndroidJavaObject javaPur public IEnumerable ParseJavaPurchaseList(AndroidJavaObject javaPurchasesList) { var parsedPurchasesList = new List(); + if (javaPurchasesList == null) + { + return parsedPurchasesList; + } + var size = javaPurchasesList.Call("size"); for (var i = 0; i < size; i++) {