diff --git a/src/Plugin.InAppBilling.Android/InAppBillingImplementation.cs b/src/Plugin.InAppBilling.Android/InAppBillingImplementation.cs index bba0f20..fece0ac 100644 --- a/src/Plugin.InAppBilling.Android/InAppBillingImplementation.cs +++ b/src/Plugin.InAppBilling.Android/InAppBillingImplementation.cs @@ -347,7 +347,7 @@ async Task PurchaseAsync(string productSku, string itemType, string pa { var purchases = await GetPurchasesAsync(itemType, verifyPurchase); - var purchase = purchases.FirstOrDefault(p => p.ProductId == productSku && payload.Equals(p.DeveloperPayload)); + var purchase = purchases.FirstOrDefault(p => p.ProductId == productSku && payload.Equals(p.DeveloperPayload ?? string.Empty)); return purchase; } @@ -355,7 +355,7 @@ async Task PurchaseAsync(string productSku, string itemType, string pa if (verifyPurchase == null || await verifyPurchase.VerifyPurchase(data, sign)) { var purchase = JsonConvert.DeserializeObject(data); - if (purchase.ProductId == productSku && payload.Equals(purchase.DeveloperPayload)) + if (purchase.ProductId == productSku && payload.Equals(purchase.DeveloperPayload ?? string.Empty)) return purchase; }