From 3117b1d117d5f7702a65311b1538e846c8930a0e Mon Sep 17 00:00:00 2001 From: cristian-montejano <82479796+cristian-montejano@users.noreply.github.com> Date: Mon, 27 Sep 2021 17:26:21 -0500 Subject: [PATCH 1/2] handle empty sku array --- android/src/play/java/com/dooboolab/RNIap/RNIapModule.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/src/play/java/com/dooboolab/RNIap/RNIapModule.java b/android/src/play/java/com/dooboolab/RNIap/RNIapModule.java index 1f040e337..815f9d361 100644 --- a/android/src/play/java/com/dooboolab/RNIap/RNIapModule.java +++ b/android/src/play/java/com/dooboolab/RNIap/RNIapModule.java @@ -221,6 +221,11 @@ public void flushFailedPurchasesCachedAsPending(final Promise promise) { @ReactMethod public void getItemsByType(final String type, final ReadableArray skuArr, final Promise promise) { + + if (skuArr.size() >= 0) { + promise.reject("There was an issue obtaining products. Please try again later."); + } + ensureConnection( promise, billingClient -> { From 3aac04a6f688889a092be51bd66871c699b4d1b9 Mon Sep 17 00:00:00 2001 From: cristian-montejano <82479796+cristian-montejano@users.noreply.github.com> Date: Mon, 27 Sep 2021 17:27:49 -0500 Subject: [PATCH 2/2] Update RNIapModule.java -woops --- android/src/play/java/com/dooboolab/RNIap/RNIapModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/play/java/com/dooboolab/RNIap/RNIapModule.java b/android/src/play/java/com/dooboolab/RNIap/RNIapModule.java index 815f9d361..90bb946d8 100644 --- a/android/src/play/java/com/dooboolab/RNIap/RNIapModule.java +++ b/android/src/play/java/com/dooboolab/RNIap/RNIapModule.java @@ -222,7 +222,7 @@ public void flushFailedPurchasesCachedAsPending(final Promise promise) { @ReactMethod public void getItemsByType(final String type, final ReadableArray skuArr, final Promise promise) { - if (skuArr.size() >= 0) { + if (skuArr.size() <= 0) { promise.reject("There was an issue obtaining products. Please try again later."); }