Skip to content

Commit

Permalink
fix: Fix filter of undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
mheggelund committed Dec 28, 2023
1 parent bf725b5 commit e7f687d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ export const CaseResultView = ({
key={obj.computeCaseId}
data={obj}
computeCase={
computeCases &&
computeCases.filter(
(c) => c.computeCaseId === obj.computeCaseId,
)
computeCases && computeCases.length > 0
? computeCases.filter(
(c) => c.computeCaseId === obj.computeCaseId,
)
: []
}
></ChannelResultTable>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ export const ChannelResultTable = ({
};

let modelArea = '';
if (computeCase && computeCase[0].modelArea !== null)
if (
computeCase &&
computeCase[0] &&
computeCase[0].modelArea !== undefined &&
computeCase[0].modelArea !== null
)
modelArea = computeCase && computeCase[0].modelArea.name;

if (modelArea === '') modelArea = 'Whole model';
Expand Down

0 comments on commit e7f687d

Please sign in to comment.