From 1f0e04e28ccb0fe828ba1dc30bb15caacd9529f7 Mon Sep 17 00:00:00 2001 From: Thomas Lund Fagermyr <35408743+thomaslf97@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:51:39 +0200 Subject: [PATCH] fix: Added null checks for failing value (#335) --- .../VariogramResultTable/VariogramResultTable.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/features/Results/CaseResult/CaseResultView/VariogramCaseResult/VariogramResultTable/VariogramResultTable.tsx b/src/features/Results/CaseResult/CaseResultView/VariogramCaseResult/VariogramResultTable/VariogramResultTable.tsx index 9fd08e6..5eae068 100644 --- a/src/features/Results/CaseResult/CaseResultView/VariogramCaseResult/VariogramResultTable/VariogramResultTable.tsx +++ b/src/features/Results/CaseResult/CaseResultView/VariogramCaseResult/VariogramResultTable/VariogramResultTable.tsx @@ -39,7 +39,7 @@ export const VariogramResultTable = ({ const resultElementsList: ResultObjectType[] = resultList.map((e) => { const method = caseList.data?.data.filter( (c) => c.computeCaseId === e.computeCaseId, - )[0].computeMethod.name; + )[0]?.computeMethod?.name; let parameter = ''; if (method === 'Indicator') { parameter = e.indicator ? e.indicator : ''; @@ -51,7 +51,7 @@ export const VariogramResultTable = ({ const modelArea = caseList.data?.data.filter( (c) => c.computeCaseId === e.computeCaseId, - )[0].modelArea; + )[0]?.modelArea; const element: ResultObjectType = { variogramResultId: e.variogramResultId, @@ -71,7 +71,7 @@ export const VariogramResultTable = ({ const handleImageDialog = (id: string, variogramResultId: string) => { const computeCaseResults = resultList.filter((e) => e.computeCaseId === id); const resultFile = computeCaseResults - .find((r) => r.variogramResultId == variogramResultId)! + .find((r) => r.variogramResultId === variogramResultId)! .variogramResultFiles.find((x) => x.fileName.includes('variogram_slices_'), );