fix: handle undefined instance object (#3042)

Some DisplaySets don't have a `instance` property, thus throwing an error at this location. 

This change fixes this issue.
This commit is contained in:
Gabriel Lebaudy 2022-11-30 17:35:27 +01:00 committed by GitHub
parent bbd962f0b4
commit 71d736067d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1332,9 +1332,7 @@ class SegmentationService {
segDisplaySetInstanceUID
);
const {
FrameOfReferenceUID: segFrameOfReferenceUID,
} = segDisplaySet.instance;
const segFrameOfReferenceUID = segDisplaySet.instance?.FrameOfReferenceUID;
viewportDisplaySetInstanceUIDs.forEach(displaySetInstanceUID => {
// check if the displaySet is sharing the same frameOfReferenceUID