From 6ca26591df5989c435b12c26222cba15d9233078 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 13 May 2010 15:32:46 +0100 Subject: [PATCH 1/1] Ignore unknown countries when doing geolocation --- lib/osm.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/osm.rb b/lib/osm.rb index c92655aee..704bc099c 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -471,9 +471,7 @@ module OSM def self.IPLocation(ip_address) code = OSM.IPToCountry(ip_address) - unless code.nil? - country = Country.find_by_code(code) - + if code and country = Country.find_by_code(code) return { :minlon => country.min_lon, :minlat => country.min_lat, :maxlon => country.max_lon, :maxlat => country.max_lat } end -- 2.43.2