Skip to content
Snippets Groups Projects
Commit 6b0af4f6 authored by Alex Reisner's avatar Alex Reisner
Browse files

Avoid error when hash key missing.

Addresses issue #450. Wish we had sample response to see exactly what
data was returned, but we don't.
parent 815681d9
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ module Geocoder::Result ...@@ -12,7 +12,7 @@ module Geocoder::Result
end end
def city def city
if state.empty? if state.empty? and address_details.has_key? 'Locality'
address_details['Locality']['LocalityName'] address_details['Locality']['LocalityName']
elsif sub_state.empty? elsif sub_state.empty?
address_details['AdministrativeArea']['Locality']['LocalityName'] address_details['AdministrativeArea']['Locality']['LocalityName']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment