Check if purchase callback is null

This happens if purchase fails before purchase intent is started
pull/413/head
Alex Baker 8 years ago
parent ae48ec7c99
commit 33d6c88a9a

@ -178,7 +178,9 @@ public class PurchaseHelper implements IabHelper.OnIabSetupFinishedListener {
result.getResponse() != IabHelper.IABHELPER_USER_CANCELLED) {
Toast.makeText(activity, result.getMessage(), Toast.LENGTH_LONG).show();
}
activityResultCallback.purchaseCompleted(result.isSuccess(), sku);
if (activityResultCallback != null) {
activityResultCallback.purchaseCompleted(result.isSuccess(), sku);
}
disposeIabHelper();
}
});

Loading…
Cancel
Save