diff --git a/lib/geocoder/lookups/freegeoip.rb b/lib/geocoder/lookups/freegeoip.rb index 9ff4ac4a2cdf6e4de801474a48564ae861194610..d9112bf8f3cf2559a8f7074d1f95aa589a47dcf1 100644 --- a/lib/geocoder/lookups/freegeoip.rb +++ b/lib/geocoder/lookups/freegeoip.rb @@ -10,7 +10,7 @@ module Geocoder::Lookup # don't look up a loopback address, just return the stored result return [reserved_result(query)] if loopback_address?(query) begin - return [fetch_data(query, reverse)] + return (doc = fetch_data(query, reverse)) ? [doc] : [] rescue StandardError # Freegeoip.net returns HTML on bad request return [] end