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,11 +266,12 @@ module Geocoder::Store
#
def reverse_geocode
do_lookup(true) do |o,rs|
r = rs.first
unless r.address.nil?
o.send :write_attribute, self.class.geocoder_options[:fetched_address], r.address
if r = rs.first
unless r.address.nil?
o.send :write_attribute, self.class.geocoder_options[:fetched_address], r.address
end
r.address
end
r.address
end
end
......
......@@ -71,11 +71,12 @@ module Geocoder::Store
#
def reverse_geocode
do_lookup(true) do |o,rs|
r = rs.first
unless r.address.nil?
o.send :write_attribute, self.class.geocoder_options[:fetched_address], r.address
if r = rs.first
unless r.address.nil?
o.send :write_attribute, self.class.geocoder_options[:fetched_address], r.address
end
r.address
end
r.address
end
end
end
......
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