1
0
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:
patrik
2012-01-29 05:52:04 +00:00
parent 6724733817
commit 1c38198c02

View File

@@ -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