Skip to content

Commit 6b8c7cf

Browse files
Update observationCmpView.js
- fixes case when obsolete observation is a main observation
1 parent 1119f20 commit 6b8c7cf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

js/components/preview/molecule/observationCmpView/observationCmpView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ const ObservationCmpView = memo(
13341334
// name: "nonsense-34"
13351335
// type: "nonsense_id"
13361336
// url: null
1337-
const searchedIdentifier = mainObservation.identifiers.find(
1337+
const searchedIdentifier = mainObservation?.identifiers.find(
13381338
identifier => identifier.type === preferredIdentifierType
13391339
);
13401340
if (searchedIdentifier) {
@@ -1403,7 +1403,7 @@ const ObservationCmpView = memo(
14031403
</Tooltip>
14041404
{aliasOrder?.map((alias, index) => {
14051405
const compoundCode =
1406-
mainObservation.identifiers.find(identifier => identifier.type === alias)?.name ?? '';
1406+
mainObservation?.identifiers.find(identifier => identifier.type === alias)?.name ?? '';
14071407
return (
14081408
<Tooltip key={index} title={`Click to copy value of ${alias}`}>
14091409
<TableRow

0 commit comments

Comments
 (0)