-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
react-native -v
: 0.45.1node -v
: 7.9.0npm -v
: 4.2.0yarn --version
: 0.23.2
Then, specify:
- Target Platform: Android
- Development Operating System: macOC Sierra
- Build tools: Android Studio
Steps to Reproduce
- ask for permission just like in documentation
- press home button
- open the App again and it crashes on this line
if (results[0] == PackageManager.PERMISSION_GRANTED) {
Expected Behavior
Check results array before accessing it.
instead of
if (results[0] == PackageManager.PERMISSION_GRANTED) {
something like
if (results.length > 0 && results[0] == PackageManager.PERMISSION_GRANTED) {
Actual Behavior
On some devices app crashes after Requesting a permission on Android. App crashed on Xiaomi Redmi 4 Prime(Android 6.0.1), Lenovo C2 (Android 6.0), Sony Xperia Z3Compact (Android 6.0.1), Samsung Galaxy A3 (Android 7.0.). App is not crashing on Huawei P10 lite(Android 7) or Sony Xperia L1(Android 7). After crash, the app is restarted.
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
michalpetrov and RafaelMagalhaesNRafaelMagalhaesN
Metadata
Metadata
Assignees
Labels
StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.