-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Bug]: Attempt to read from null error in Explore -> Map fragment #5457
Comments
@kanahia1 this might happen because you are using the betaDebug variant, as was the case here #5255 (comment), pointed out by @nicolas-raoul here: #5255 (comment). Does the issue persist in prodDebug variant as well? |
Thanks @ShashwatKedia it worked! on production server. But we will need to handle it since there can be a place on earth where are no images in that case there will be this error. So, we can show some dialog at that place to make user experience better. |
Using dialogues can be interrupting for users. Instead, we should use Although, we can move from |
Yes snackbar is good. I think we should try to convey the real problem to the user, though. Here, the real problem is that there are no Wikidata items in that area, right? |
No problem, I am adding a new string in the resource. This will be displayed to the user. |
How about |
Well, this seems to be a good response we can provide. I am placing it in the resources. |
Ah, no_nearby_places_around is great, thanks for finding it! 🙂 |
Ah wait, I was totally forgetting the context since yesterday, I am so sorry! 😱 Please use "No pictures in this area". Thanks! 🙂 |
Hey @rohit9625, References |
Oh, my bad!😅 |
@rohit9625 Your screenshot looks great! 🙂 |
Hey @rohit9625, I have added TODO for snackbar in #5475, you can add code for snackbar and share a pull request. 🙌 |
Okay I'll do it :) |
Sure @rohit9625 I will look into #5487 |
Done Mr. @kanahia1 👍 |
Hello @nicolas-raoul |
Summary
This issue is caused when there are no elements in
mediaList
Maybe the issue caused when there are no media (images) available at specific coordinate.Steps to reproduce
Expected behaviour
Place's images should appear on the map.
Actual behaviour
Toast message
Error fetching nearby places. Attempt to read from null...
Device name
Samsung S21
Android version
Android 14
Commons app version
4.2.1-debug-HEAD~9be8df3
Device logs
java.lang.NullPointerException: Attempt to read from null array at fr.free.nrw.commons.explore.map.ExploreMapPresenter.getLatLngBounds(ExploreMapPresenter.java:223) at fr.free.nrw.commons.explore.map.ExploreMapPresenter.updateMapMarkers(ExploreMapPresenter.java:193) at fr.free.nrw.commons.explore.map.ExploreMapFragment.updateMapMarkers(ExploreMapFragment.java:433) at fr.free.nrw.commons.explore.map.ExploreMapFragment.lambda$populatePlaces$5$fr-free-nrw-commons-explore-map-ExploreMapFragment(ExploreMapFragment.java:413)
Screen-shots
WhatsApp.Video.2024-01-19.at.12.32.38_ef292d87.mp4
Would you like to work on the issue?
Yes
The text was updated successfully, but these errors were encountered: