diff --git a/RoomsEyeView/Resources/UI/qSlicerRoomsEyeViewModule.ui b/RoomsEyeView/Resources/UI/qSlicerRoomsEyeViewModule.ui
index 4e42607f..22915dc7 100644
--- a/RoomsEyeView/Resources/UI/qSlicerRoomsEyeViewModule.ui
+++ b/RoomsEyeView/Resources/UI/qSlicerRoomsEyeViewModule.ui
@@ -449,6 +449,9 @@
vtkMRMLRTBeamNode
+
+ true
+
-
diff --git a/RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.cxx b/RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.cxx
index 281d1ad2..688203e8 100644
--- a/RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.cxx
+++ b/RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.cxx
@@ -400,9 +400,6 @@ void qSlicerRoomsEyeViewModuleWidget::onBeamNodeChanged(vtkMRMLNode* node)
paramNode->SetAndObserveBeamNode(beamNode);
paramNode->DisableModifiedEventOff();
- // Trigger update of transforms based on selected beam
- beamNode->InvokeCustomModifiedEvent(vtkMRMLRTBeamNode::BeamTransformModified);
-
// Show only selected beam, hide others
std::vector beamNodes;
this->mrmlScene()->GetNodesByClass("vtkMRMLRTBeamNode", beamNodes);
@@ -413,6 +410,14 @@ void qSlicerRoomsEyeViewModuleWidget::onBeamNodeChanged(vtkMRMLNode* node)
shNode->GetItemByDataNode(currentBeamNode), (currentBeamNode == beamNode ? 1 : 0) );
}
+ if (!beamNode)
+ {
+ return;
+ }
+
+ // Trigger update of transforms based on selected beam
+ beamNode->InvokeCustomModifiedEvent(vtkMRMLRTBeamNode::BeamTransformModified);
+
// Select patient segmentation
vtkMRMLRTPlanNode* planNode = beamNode->GetParentPlanNode();
if (!planNode)