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

Merge pull request #157 from JustinLove/master

Ensure all do_lookup blocks have empty list protection
parents 0e157f67 b637884b
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