Resolves NPE when opening app without location permission and mobile data#6345
Resolves NPE when opening app without location permission and mobile data#6345kamalnathvg wants to merge 3 commits intocommons-app:mainfrom
Conversation
| localPlaceSearchJob = scope.launch(Dispatchers.IO) { | ||
| delay(LOCAL_SCROLL_DELAY) | ||
| val mapFocus = nearbyParentFragmentView.mapFocus | ||
| val mapFocus = nearbyParentFragmentView.mapFocus ?: return@launch |
There was a problem hiding this comment.
to handle the case when Permission dialog is active above NearbyParentFragment leading to null values for nearbyParentFragment.mapFocus, nearbyParentFragment.screenBottomLeft and nearbyParentFragment.screenTopRight
Haven't tested yet but the NPE is happening at fetchPlaces() if I understand the logs correctly. Just thinking: can we still have cases where the other two could be null and we end up passing them to this function? Should we handle all of them since these are completely independent values and not calculated using any one of them?
There was a problem hiding this comment.
@kamalnathvg did you get a chance to review this comment? We're returning in the beginning itself so it covers the case you mentioned but map centre calculation is a bit different from the corners and even retrieved from the kv store in the later runs. Just wanted to ensure we're not missing any case and then I'll merge this PR :)
|
✅ Generated APK variants! |
Fixes NPE when opening app without location permission and mobile data
Fixes #6330
Added Null Check for
NearbyParentFragment.mapFocusto handle the case when Permission dialog is active aboveNearbyParentFragmentleading to null values fornearbyParentFragment.mapFocus,nearbyParentFragment.screenBottomLeftandnearbyParentFragment.screenTopRight.Reproduce Issue by:
ask every time.Before Fix
6330-before.mp4
After Fix
6330-after.mp4
Tested on:
Device : Pixel 8
API Level: 35