Browse Source

Some more nil checks.

master
onefang 3 years ago
parent
commit
b396f0a3e2
  1. 24
      apt-panopticon-report-email-web.lua

24
apt-panopticon-report-email-web.lua

@ -28,7 +28,7 @@ local revDNS = function(hosts, dom, IP)
end
else
for k, v in pairs(hosts) do
if APT.options.roundRobin.value ~= k then
if (APT.options.roundRobin.value ~= k) and (nil ~= v.IPs) then
local IPs = v.IPs
for i, u in pairs(IPs) do
if "table" == type(u) then
@ -184,7 +184,7 @@ local DNSrrTest = function(hosts, k)
space = '   '
no = "<font color='grey'><b>no</b></font>"
end
if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) then
if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) and (nil ~= hosts[k].IPs) then
APT.allpairs(hosts[k].IPs,
function(i, w, k, v)
if nil ~= hosts[APT.options.roundRobin.value].IPs["deb.roundr.devuan.org"][i] then
@ -323,16 +323,18 @@ local makeIPlist = function(hosts)
hosts[k].Country = nil
hosts[k].Bandwidth = nil
for l, w in pairs(hosts[k].IPs) do
if type(w) == "table" then
n[l] = {}
for i, u in pairs(w) do
local log = '[<a href="' .. adr .. k .. '_' .. i .. '">graphs</a>] &nbsp; ' .. logCount(k, i)
if "" == log then n[l][i] = u else n[l][log .. " " .. revDNS(hosts, k, i)] = u end
if nil ~= hosts[k].IPs then
for l, w in pairs(hosts[k].IPs) do
if type(w) == "table" then
n[l] = {}
for i, u in pairs(w) do
local log = '[<a href="' .. adr .. k .. '_' .. i .. '">graphs</a>] &nbsp; ' .. logCount(k, i)
if "" == log then n[l][i] = u else n[l][log .. " " .. revDNS(hosts, k, i)] = u end
end
else
local log = '[<a href="' .. adr .. k .. '_' .. l .. '">graphs</a>] &nbsp; ' .. logCount(k, l)
if "" == log then n[l] = w else n[log .. " " .. revDNS(hosts, k, l)] = w end
end
else
local log = '[<a href="' .. adr .. k .. '_' .. l .. '">graphs</a>] &nbsp; ' .. logCount(k, l)
if "" == log then n[l] = w else n[log .. " " .. revDNS(hosts, k, l)] = w end
end
end
m['[<a href="' .. adr .. k .. '">graphs</a>] &nbsp; ' .. log .. " DNS entries -" .. redirs(hosts, k)] = n

Loading…
Cancel
Save