Fix geocoding crash

This commit is contained in:
Alexey Kulish 2016-08-08 15:49:10 +03:00
parent 30ea0c5e6c
commit c21c8ad903

View file

@ -77,7 +77,7 @@ public class CurrentPositionHelper implements ResourceListener {
protected Void doInBackground(Void... params) {
try {
processGeocoding(loc, geoCoding, storeFound, result);
} catch (IOException e) {
} catch (Exception e) {
e.printStackTrace();
}
return null;
@ -111,6 +111,7 @@ public class CurrentPositionHelper implements ResourceListener {
protected void justifyResult(List<GeocodingResult> res, final ResultMatcher<GeocodingResult> result) {
List<GeocodingResult> complete = new ArrayList<>();
double minBuildingDistance = 0;
if (res != null) {
for (GeocodingResult r : res) {
Collection<RegionAddressRepository> rar = app.getResourceManager().getAddressRepositories();
RegionAddressRepository foundRepo = null;
@ -146,6 +147,8 @@ public class CurrentPositionHelper implements ResourceListener {
complete.add(r);
}
}
}
if (result.isCancelled()) {
app.runInUIThread(new Runnable() {
public void run() {
@ -225,7 +228,12 @@ public class CurrentPositionHelper implements ResourceListener {
return null;
}
}
try {
return new GeocodingUtilities().reverseGeocodingSearch(geocoding ? defCtx : ctx, lat, lon);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@Override