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 authored and GitHub committed 2022-11-30 11:35:27 -05:00
1 parent bbd962f0b4
commit 71d736067d
1 file changed
+1 -3
@@ -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