Skip to content

Commit

Permalink
Merge pull request snabbco#1082 from dpino/fix-index-nil
Browse files Browse the repository at this point in the history
Fix attempt to index a nil value
  • Loading branch information
dpino authored Jun 6, 2018
2 parents 4d9f344 + f5fd15e commit be449cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/ptree/ptree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit be449cb

Please sign in to comment.