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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user