diff --git a/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx b/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx index 65357295b..7dda524c4 100644 --- a/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx +++ b/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx @@ -97,18 +97,20 @@ export function DmsAllocationsSummary({ socket, bodyshop, jobId, title }) { dataSource={allocationsSummary} locale={{ emptyText: t("dms.labels.refreshallocations") }} summary={() => { - const totals = allocationsSummary.reduce( - (acc, val) => { - return { - totalSale: acc.totalSale.add(Dinero(val.sale)), - totalCost: acc.totalCost.add(Dinero(val.cost)), - }; - }, - { - totalSale: Dinero(), - totalCost: Dinero(), - } - ); + const totals = + allocationsSummary && + allocationsSummary.reduce( + (acc, val) => { + return { + totalSale: acc.totalSale.add(Dinero(val.sale)), + totalCost: acc.totalCost.add(Dinero(val.cost)), + }; + }, + { + totalSale: Dinero(), + totalCost: Dinero(), + } + ); return ( @@ -118,7 +120,7 @@ export function DmsAllocationsSummary({ socket, bodyshop, jobId, title }) { - {totals.totalSale.toFormat()} + {totals && totals.totalSale.toFormat()} { diff --git a/client/src/components/dms-log-events/dms-log-events.component.jsx b/client/src/components/dms-log-events/dms-log-events.component.jsx index 8f57158e5..8925262dd 100644 --- a/client/src/components/dms-log-events/dms-log-events.component.jsx +++ b/client/src/components/dms-log-events/dms-log-events.component.jsx @@ -23,7 +23,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(DmsLogEvents); export function DmsLogEvents({ socket, logs, bodyshop }) { return ( {logs.map((log, idx) => (