Skip to content

Commit dd4e7c3

Browse files
committed
Fixed bug when there are places nearby but none are loaded
1 parent 5447ae0 commit dd4e7c3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/NearbyPlaces.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public class NearbyPlaces {
2929
private static final Uri WIKIDATA_QUERY_URL = Uri.parse("https://query.wikidata.org/sparql");
3030
private static final Uri WIKIDATA_QUERY_UI_URL = Uri.parse("https://query.wikidata.org/");
3131
private final String wikidataQuery;
32-
private double radius = INITIAL_RADIUS;
3332
private List<Place> places;
3433

3534
public NearbyPlaces() {
@@ -43,6 +42,7 @@ public NearbyPlaces() {
4342

4443
List<Place> getFromWikidataQuery(LatLng curLatLng, String lang) {
4544
List<Place> places = Collections.emptyList();
45+
double radius = INITIAL_RADIUS;
4646

4747
try {
4848
// increase the radius gradually to find a satisfactory number of nearby places
@@ -60,7 +60,6 @@ List<Place> getFromWikidataQuery(LatLng curLatLng, String lang) {
6060
// errors tend to be caused by too many results (and time out)
6161
// try a small radius next time
6262
Timber.d("back to initial radius: %f", radius);
63-
radius = INITIAL_RADIUS;
6463
}
6564
return places;
6665
}

0 commit comments

Comments
 (0)