Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check promise before calling it in the android onActivityResult function #427

Merged
merged 2 commits into from
Jan 6, 2020

Conversation

Shervanator
Copy link
Contributor

@Shervanator Shervanator commented Dec 19, 2019

Fixes #426

Description

onActivityResult is called by all intents when returning to the app from some other location. In the case that we are returning to the app (but not for app auth/or when the intent is null) we trigger a new flow that was added here: #352
This new flow expects the promise instance variable to be set. This only happens in some of the other functions in the native module, e.g. the authorize function.

This PR ensures that we check if the promise is defined before we call it. Otherwise the app will crash (which is what I was experiencing prior to this PR)

cc @AlgirdasVZ @kadikraman

@kadikraman
Copy link
Contributor

Thanks for the PR! Happy to merge if you could resolve the conflicts (the error messaging has been changed so we could have consistent messaging across platforms)

@kadikraman
Copy link
Contributor

Nevermind - looks like I can resolve the conflicts through GitHub UI ✔️

@kadikraman kadikraman merged commit 85ce7d2 into FormidableLabs:master Jan 6, 2020
@kadikraman
Copy link
Contributor

Released in v5.0.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onActivityResult crashing when intent is null because promise is null
2 participants