Skip to content

Commit

Permalink
check for null
Browse files Browse the repository at this point in the history
-added return statement
-changed error message
  • Loading branch information
cristian-montejano committed Sep 27, 2021
1 parent 2e07b58 commit ef8ed97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions android/src/play/java/com/dooboolab/RNIap/RNIapModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ 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.");
if (skuArr.size() <= 0 || skuArr.isNull(0)) {
promise.reject("There was an error fetching products. Please try again later.");
return;
}

ensureConnection(
Expand Down

0 comments on commit ef8ed97

Please sign in to comment.