From 438496c6575ad037a2ec6ef0af3a112f80d446bc Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 1 Jan 2020 22:28:08 +0000 Subject: [PATCH] Fix hostip.info fallback --- lib/osm.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/osm.rb b/lib/osm.rb index bc3eb48c5..26ebca09f 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -513,7 +513,7 @@ module OSM def self.ip_to_country(ip_address) ipinfo = maxmind_database.lookup(ip_address) if Settings.key?(:maxmind_database) - if ipinfo.found? + if ipinfo&.found? country = ipinfo.country.iso_code else country = http_client.get("https://api.hostip.info/country.php?ip=#{ip_address}").body -- 2.39.5