Skip empty report datasets instead of calling max() on them (#136)

This commit is contained in:
Run_as_daemon
2026-11-01 16:21:56 +03:00
committed by GitHub
parent 2f5d7d7f11
commit a355247b6e

View File

@@ -139,7 +139,7 @@ def currency_graph(start, end):
else:
data.append(0)
color = "#" + character.name.encode("utf-8").hex()[1:7]
if max(data) > 10000:
if data and max(data) > 10000:
datasets.append({
"label": character.name,
"data": data,
@@ -194,7 +194,7 @@ def uscore_graph(start, end):
else:
data.append(0)
color = "#" + character.name.encode("utf-8").hex()[1:7]
if max(data) > 1000:
if data and max(data) > 1000:
datasets.append({
"label": character.name,
"data": data,