From 498292c2ec98dfc0237e8d2fe307ab3da8e52735 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Mon, 5 Feb 2024 11:35:24 -0500 Subject: [PATCH] - Fix for job line null check Signed-off-by: Dave Richer --- .../jobs-detail-dates/jobs-detail-dates.component.jsx | 4 ++-- .../jobs-detail-header-actions.component.jsx | 2 +- .../jobs-detail-header/jobs-detail-header.component.jsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/components/jobs-detail-dates/jobs-detail-dates.component.jsx b/client/src/components/jobs-detail-dates/jobs-detail-dates.component.jsx index dcd6fd941..c2e2091d1 100644 --- a/client/src/components/jobs-detail-dates/jobs-detail-dates.component.jsx +++ b/client/src/components/jobs-detail-dates/jobs-detail-dates.component.jsx @@ -23,9 +23,9 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) { ); }, [job.status, bodyshop.md_ro_statuses.post_production_statuses]); - const calcRepairDays = + const calcRepairDays = job?.joblines?.length ? job.joblines.reduce((acc, val) => acc + val.mod_lb_hrs, 0) / - (bodyshop.target_touchtime === 0 ? 1 : bodyshop.target_touchtime); + (bodyshop.target_touchtime === 0 ? 1 : bodyshop.target_touchtime) : []; return (
diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx index e396982d8..cd7b81456 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx @@ -879,7 +879,7 @@ export function JobsDetailHeaderActions({ }, ]; - if (job.csiinvites.length) { + if (job?.csiinvites?.length) { children.push( { type: "divider" diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx index 7c58eda52..cbcb91807 100644 --- a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx +++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx @@ -121,7 +121,7 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) { {job.alt_transport} - {job.cccontracts.length > 0 && ( + {job?.cccontracts?.length > 0 && ( {job.cccontracts.map((c) => (