From f5fd15efb4aaa55bf68cd608333a741e5d5d8f51 Mon Sep 17 00:00:00 2001 From: Diego Pino Garcia Date: Wed, 6 Jun 2018 14:35:03 +0000 Subject: [PATCH] Fix attempt to index a nil value --- src/lib/ptree/ptree.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/ptree/ptree.lua b/src/lib/ptree/ptree.lua index 51ee8ac433..94d7765092 100644 --- a/src/lib/ptree/ptree.lua +++ b/src/lib/ptree/ptree.lua @@ -335,7 +335,8 @@ end -- accumulative sum. Accumulative sum is initialized to aggregated counter -- value if any. local function compute_aggregated_value (k) - local ret = counters.archived[k][0] or 0 + if not counters.archived[k] then return 0 end + local ret = counters.archived[k][0] for _,c in pairs(counters.active[k]) do ret = ret + counter.read(c) end