fix: ensure we don't try to add int and NoneType

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2024-04-03 13:58:23 +05:30
parent 61dfbe2f9f
commit c2d8ee2bbb
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -303,8 +303,8 @@ def get_result(data, timegrain, from_date, to_date, chart_type):
for d in result:
count = 0
while data_index < len(data) and getdate(data[data_index][0]) <= d[0]:
d[1] += data[data_index][1]
count += data[data_index][2]
d[1] += cint(data[data_index][1])
count += cint(data[data_index][2])
data_index += 1
if chart_type == "Average" and count != 0:
d[1] = d[1] / count