update: safeguard when the backend may not yet support the metrics for db read/writes.

This commit is contained in:
Darshan
2025-01-29 12:29:08 +05:30
parent bb04620771
commit b3f06d23a8
+1 -1
View File
@@ -43,7 +43,7 @@
metrics: Models.Metric[],
endingTotal: number
): Array<[string, number]> {
return metrics.reduceRight(
return (metrics ?? []).reduceRight(
(acc, curr) => {
acc.data.unshift([curr.date, acc.total]);
acc.total -= curr.value;