mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 20:29:03 +00:00
Changed JSON null-check to the json.NULL constant per David's recommendation.
This commit is contained in:
@@ -41,9 +41,7 @@ local geoplugin = function(ip)
|
||||
|
||||
local output = {}
|
||||
table.insert(output, "coordinates (lat,lon): "..loc.geoplugin_latitude..","..loc.geoplugin_longitude)
|
||||
-- The JSON response for regionName contains a null sometimes which is represented
|
||||
-- as a table by the library.
|
||||
local regionName = ("table" == type(loc.geoplugin_regionName)) and "Unknown" or loc.geoplugin_regionName
|
||||
local regionName = (loc.geoplugin_regionName == json.NULL) and "Unknown" or loc.geoplugin_regionName
|
||||
table.insert(output,"state: ".. regionName ..", ".. loc.geoplugin_countryName)
|
||||
|
||||
return output
|
||||
|
||||
Reference in New Issue
Block a user