Skip to content

Commit

Permalink
Fix for double callback consume crash
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-alexeichik authored and hyochan committed Feb 12, 2019
1 parent c71a052 commit 1286b3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions android/src/main/java/com/dooboolab/RNIap/RNIapModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ private void ensureConnection (final Promise promise, final Runnable callback) {

@Override
public void onBillingSetupFinished(@BillingClient.BillingResponse int responseCode) {
if (responseCode == BillingClient.BillingResponse.OK ) {
Log.d(TAG, "billing client ready");
if (!bSetupCallbackConsumed) {
bSetupCallbackConsumed = true;
if (!bSetupCallbackConsumed) {
bSetupCallbackConsumed = true;
if (responseCode == BillingClient.BillingResponse.OK ) {
Log.d(TAG, "billing client ready");
callback.run();
} else {
rejectPromiseWithBillingError(promise, responseCode);
}
} else {
rejectPromiseWithBillingError(promise, responseCode);
}
}

Expand Down

0 comments on commit 1286b3c

Please sign in to comment.