Skip to content

Commit

Permalink
Fix android tv upgrade cancel crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ginder-Singh committed Mar 31, 2024
1 parent c3eaab2 commit 6200698
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;


Expand Down Expand Up @@ -137,7 +138,11 @@ public void launchBillingFlow(AppCompatActivity mActivity, BillingFlowParams par

@Override
public void onPurchasesUpdated(@NonNull BillingResult billingResult, @Nullable List<Purchase> purchases) {
purchaseUpdateEvent.postValue(new CustomPurchases(billingResult.getResponseCode(), purchases));
if (purchases == null){
purchaseUpdateEvent.postValue(new CustomPurchases(billingResult.getResponseCode(), new ArrayList<>()));
} else {
purchaseUpdateEvent.postValue(new CustomPurchases(billingResult.getResponseCode(), purchases));
}
}

public void querySkuDetailsAsync(final List<QueryProductDetailsParams.Product> subs) {
Expand Down

0 comments on commit 6200698

Please sign in to comment.