Skip to content

Commit

Permalink
Bugfix Geocoding
Browse files Browse the repository at this point in the history
  • Loading branch information
at-dro committed Jul 10, 2017
1 parent 83e4750 commit 55b9e86
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ public ChainedGeocoder(Geocoder<Address>... geocoders) {
@Override
public LatLng geocode(Address address) {
// First look in cache
CacheEntry entry = cacheRepository.findOne(Example.of(new CacheEntry(address), addressMatcher));
if (entry != null) {
List<CacheEntry> entries = cacheRepository.findAll(Example.of(new CacheEntry(address), addressMatcher));
if (!entries.isEmpty()) {
LOG.debug("Found coordinates for address '{}' in cache", address);
return entry.getCoordinates();
return entries.get(0).getCoordinates();
}

// Now try all the geocoders in order
Expand Down

0 comments on commit 55b9e86

Please sign in to comment.