-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[PermissionsAndroid] Prevent app from crashing when getCurrentActivity is null #10351
Conversation
By analyzing the blame information on this pull request, we identified @andreicoman11 and @mikelambert to be potential reviewers. |
Thanks a lot! @facebook-github-bot shipit |
Thanks for importing. If you are a Facebook employee, you can view this diff on Phabricator. |
cc @grabbou can we cherry-pick this to the stable release? |
Hey guys, we're seeing a lot of crashes on Android and this should fix them. Could we get this commit in the 0.36 ? Thanks! |
Summary: We're seeing a lot of crashes from `PermissionsModule` not being able to access the current activity, mentioned in #10009 and here: #9310 (comment) As far as I can tell, there is no way to ensure the Activity exists since the `ReactContext` holds a `WeakReference` to the current Activity and it appears that the lifecycle calls are happening in the right order (so not the same as #9310). This will at least allow people to catch the error in JS and update the UI or try again as opposed to crashing the app. I'm working on some bigger changes in #10221 but this is a smaller change and important to get fixed I think. Closes #10351 Differential Revision: D4010242 fbshipit-source-id: 7a76973bb2b3e45817d4283917740c89a10ec0b0
We're seeing a lot of crashes from
PermissionsModule
not being able to access the current activity, mentioned in #10009 and here: #9310 (comment)As far as I can tell, there is no way to ensure the Activity exists since the
ReactContext
holds aWeakReference
to the current Activity and it appears that the lifecycle calls are happening in the right order (so not the same as #9310).This will at least allow people to catch the error in JS and update the UI or try again as opposed to crashing the app.
I'm working on some bigger changes in #10221 but this is a smaller change and important to get fixed I think.