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

[Android] Fix crash when current BackStack is null #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lucas-tulio
Copy link

At some point, the backStacks object can be null, making backStacks.peek() crash the app. I could not put my finger exactly on why this happens, but I suspect it's some kind of race condition. Anyway, it's always when trying to pop().

This PR does two things to address this problem:

  1. Adds a null check before trying to peek into our backStacks.
  2. Logs a warning every time we would try to pop or push with a null backStacks. That way we won't lose track of the problem.

This fixed the problem in our production app without any side effects but maybe somebody with more context on the code can clarify why this crash happens and whether this is an acceptable fix.

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.

None yet

1 participant