X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/303e5d3eb99284ab4fa41be85f831333f2154b0d..cd3fc33171daf8ae2d2a0cc3ff4261c021da3f85:/lib/osm.rb 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