Skip to content
Snippets Groups Projects
Commit b637884b authored by Justin Love's avatar Justin Love
Browse files

ensure all do_lookup blocks have empty list protection

parent 0e157f67
No related branches found
No related tags found
No related merge requests found
......@@ -266,13 +266,14 @@ module Geocoder::Store
#
def reverse_geocode
do_lookup(true) do |o,rs|
r = rs.first
if r = rs.first
unless r.address.nil?
o.send :write_attribute, self.class.geocoder_options[:fetched_address], r.address
end
r.address
end
end
end
alias_method :fetch_address, :reverse_geocode
end
......
......@@ -71,7 +71,7 @@ module Geocoder::Store
#
def reverse_geocode
do_lookup(true) do |o,rs|
r = rs.first
if r = rs.first
unless r.address.nil?
o.send :write_attribute, self.class.geocoder_options[:fetched_address], r.address
end
......@@ -80,3 +80,4 @@ module Geocoder::Store
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment