Skip to content

Commit

Permalink
Merge pull request #120 from AndreiMisiukevich/issue111_fix
Browse files Browse the repository at this point in the history
fix #111
  • Loading branch information
jamesmontemagno authored Feb 21, 2018
2 parents aa6f418 + cddcd12 commit 1de6b2d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Plugin.InAppBilling.Android/InAppBillingImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,18 @@ public async override Task<InAppBillingPurchase> ConsumePurchaseAsync(string pro
public static void HandleActivityResult(int requestCode, Result resultCode, Intent data)
{

if (PURCHASE_REQUEST_CODE != requestCode || data == null)
if (PURCHASE_REQUEST_CODE != requestCode)
{
return;
}

if(resultCode == Result.Canceled && tcsPurchase != null && !tcsPurchase.Task.IsCompleted)
{
tcsPurchase.SetException(new InAppBillingPurchaseException(PurchaseError.UserCancelled));
return;
}

if(data == null)
{
return;
}
Expand Down

0 comments on commit 1de6b2d

Please sign in to comment.