From 6556a7f7b540fb698b5483ee2aedf4f941a96fed Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Wed, 8 May 2019 16:58:23 -0500 Subject: [PATCH] Fix crash in billing client --- .../java/org/tasks/billing/BillingClientImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/googleplay/java/org/tasks/billing/BillingClientImpl.java b/app/src/googleplay/java/org/tasks/billing/BillingClientImpl.java index dd3087952..f13e760fd 100644 --- a/app/src/googleplay/java/org/tasks/billing/BillingClientImpl.java +++ b/app/src/googleplay/java/org/tasks/billing/BillingClientImpl.java @@ -105,9 +105,13 @@ public class BillingClientImpl implements BillingClient, PurchasesUpdatedListene purchases, Single.fromCallable(() -> billingClient.queryPurchases(SkuType.SUBS)), (iaps, subs) -> { - if (subs.getResponseCode() == BillingResponse.OK) { - iaps.getPurchasesList().addAll(subs.getPurchasesList()); + if (iaps.getResponseCode() != BillingResponse.OK) { + return iaps; } + if (subs.getResponseCode() != BillingResponse.OK) { + return subs; + } + iaps.getPurchasesList().addAll(subs.getPurchasesList()); return iaps; }); }