1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-20 21:29:06 +00:00

Fixed bug that would make the script crash with the following error if the

latitude and longitude for an IP could not be determined:
attempt to concatenate field 'longitude' (a table value)
This commit is contained in:
patrik
2012-06-07 18:08:18 +00:00
parent 55572542ef
commit bbc423734e

View File

@@ -57,6 +57,10 @@ local geobytes = function(ip)
return nil
end
-- Process output
-- an empty table is returned when latitude and longitude can not be determined
if ( "table" == type(loc.latitude) or "table" == type(loc.longitude) ) then
return { "Could not determine location for IP" }
end
table.insert(output, "coordinates (lat,lon): " .. loc.latitude .. "," .. loc.longitude)
table.insert(output,"city: ".. loc.city..", ".. loc.region..", ".. loc.country)
return output