From dd4e7c3aa07f78a02fef1853a6e338f11ce7038b Mon Sep 17 00:00:00 2001 From: Sergey Kozelko Date: Fri, 27 Oct 2017 14:15:25 +0300 Subject: [PATCH] Fixed bug when there are places nearby but none are loaded --- app/src/main/java/fr/free/nrw/commons/nearby/NearbyPlaces.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyPlaces.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyPlaces.java index 50d661ef6..122042eff 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyPlaces.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyPlaces.java @@ -29,7 +29,6 @@ public class NearbyPlaces { private static final Uri WIKIDATA_QUERY_URL = Uri.parse("https://query.wikidata.org/sparql"); private static final Uri WIKIDATA_QUERY_UI_URL = Uri.parse("https://query.wikidata.org/"); private final String wikidataQuery; - private double radius = INITIAL_RADIUS; private List places; public NearbyPlaces() { @@ -43,6 +42,7 @@ public class NearbyPlaces { List getFromWikidataQuery(LatLng curLatLng, String lang) { List places = Collections.emptyList(); + double radius = INITIAL_RADIUS; try { // increase the radius gradually to find a satisfactory number of nearby places @@ -60,7 +60,6 @@ public class NearbyPlaces { // errors tend to be caused by too many results (and time out) // try a small radius next time Timber.d("back to initial radius: %f", radius); - radius = INITIAL_RADIUS; } return places; }