From 2fa647fb5a2ba60dcc394ce5a223fd14b1c07aac Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 13 Nov 2019 20:36:01 +1000 Subject: Clean up a nil issue. --- apt-panopticon.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index def0197..b03810c 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -164,9 +164,12 @@ local log = function(v, t, s, prot, test, host) t = t .. "(" .. x .. ")" if "" ~= prot then if "" == test then + if nil == results[prot] then results[prot] = {errors = 0; warnings = 0} end if v == 0 then results[prot].errors = results[prot].errors + 1 end if v == 1 then results[prot].warnings = results[prot].warnings + 1 end else + if nil == results[prot] then results[prot] = {errors = 0; warnings = 0} end + if nil == results[prot][test] then results[prot][test] = {errors = 0; warnings = 0} end if v == 0 then results[prot][test].errors = results[prot][test].errors + 1 end if v == 1 then results[prot][test].warnings = results[prot][test].warnings + 1 end end -- cgit v1.1