Skip to content

Commit

Permalink
Add safety checks
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Jan 27, 2025
1 parent 94916a3 commit ebe9018
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/lua/modules/graph_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,11 @@ function graph_utils.merge_pie_data(aggregated_data, data, max_values)
-- Note: aggregated_data may be nil
local items = {}
if aggregated_data then
for _, l in ipairs(aggregated_data.labels) do
for _, l in ipairs(aggregated_data.labels or {}) do
items[l] = aggregated_data.series[_]
end
end
for _, l in ipairs(data.labels) do
for _, l in ipairs(data.labels or {}) do
if items[l] then
items[l] = items[l] + data.series[_]
else
Expand Down

0 comments on commit ebe9018

Please sign in to comment.