IO-1273 Graceful error on job totals.

This commit is contained in:
Patrick Fic
2021-07-27 11:19:23 -07:00
parent 8ca3741a52
commit 35323ba624
3 changed files with 9 additions and 3 deletions

View File

@@ -13,7 +13,10 @@ export default function DashboardProjectedMonthlySales({ data, ...cardProps }) {
const dollars =
data.projected_monthly_sales &&
data.projected_monthly_sales.reduce(
(acc, val) => acc.add(Dinero(val.job_totals.totals.subtotal)),
(acc, val) =>
acc.add(
Dinero(val.job_totals.totals && val.job_totals.totals.subtotal)
),
Dinero()
);
return (