Skip to content

Commit 6200698

Browse files
committed
Fix android tv upgrade cancel crash.
1 parent c3eaab2 commit 6200698

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

base/src/google/java/com.windscribe.vpn/billing/GoogleBillingManager.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.slf4j.Logger;
3434
import org.slf4j.LoggerFactory;
3535

36+
import java.util.ArrayList;
3637
import java.util.List;
3738

3839

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

138139
@Override
139140
public void onPurchasesUpdated(@NonNull BillingResult billingResult, @Nullable List<Purchase> purchases) {
140-
purchaseUpdateEvent.postValue(new CustomPurchases(billingResult.getResponseCode(), purchases));
141+
if (purchases == null){
142+
purchaseUpdateEvent.postValue(new CustomPurchases(billingResult.getResponseCode(), new ArrayList<>()));
143+
} else {
144+
purchaseUpdateEvent.postValue(new CustomPurchases(billingResult.getResponseCode(), purchases));
145+
}
141146
}
142147

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

0 commit comments

Comments
 (0)