diff --git a/android/src/main/java/com/oktareactnative/OktaSdkBridgeModule.java b/android/src/main/java/com/oktareactnative/OktaSdkBridgeModule.java index d260c740..3cf43d91 100644 --- a/android/src/main/java/com/oktareactnative/OktaSdkBridgeModule.java +++ b/android/src/main/java/com/oktareactnative/OktaSdkBridgeModule.java @@ -524,7 +524,9 @@ public void onCancel() { params.putString(OktaSdkConstant.RESOLVE_TYPE_KEY, OktaSdkConstant.CANCELLED); sendEvent(reactContext, OktaSdkConstant.ON_CANCELLED, params); final Promise promise = queuedPromise; - promise.reject(OktaSdkError.CANCELLED.getErrorCode(), OktaSdkError.CANCELLED.getErrorMessage()); + if (promise != null) { + promise.reject(OktaSdkError.CANCELLED.getErrorCode(), OktaSdkError.CANCELLED.getErrorMessage()); + } queuedPromise = null; }