Skip to content

Commit

Permalink
Fixes exception from onCancel callback
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaAvraimov-okta committed Oct 28, 2021
1 parent d01741e commit 07dddc4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 07dddc4

Please sign in to comment.