Skip to content

Commit

Permalink
Merge pull request #7 from fenderdigital/error-handling
Browse files Browse the repository at this point in the history
check for null
  • Loading branch information
cristian-montejano authored Sep 27, 2021
2 parents 2e07b58 + ef8ed97 commit bd2743e
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 bd2743e

Please sign in to comment.