diff --git a/src/frontend/src/pages/part/PartDetail.tsx b/src/frontend/src/pages/part/PartDetail.tsx index aec379ac31..fb4763b54d 100644 --- a/src/frontend/src/pages/part/PartDetail.tsx +++ b/src/frontend/src/pages/part/PartDetail.tsx @@ -403,17 +403,17 @@ export default function PartDetail() { case 200: return response.data; default: - return null; + return {}; } }) .catch(() => { - return null; + return {}; }); } }); return ( - data && + data.overall_min && `${formatPriceRange(data.overall_min, data.overall_max)}${ part.units && ' / ' + part.units }` @@ -443,19 +443,19 @@ export default function PartDetail() { if (response.data.length > 0) { return response.data[response.data.length - 1]; } else { - return null; + return {}; } default: - return null; + return {}; } }) .catch(() => { - return null; + return {}; }); } }); - if (data.quantity) { + if (data && data.quantity) { return `${data.quantity} (${data.date})`; } else { return '-'; @@ -482,11 +482,11 @@ export default function PartDetail() { case 200: return response.data[response.data.length - 1]; default: - return null; + return {}; } }) .catch(() => { - return null; + return {}; }); } });