Skip to content
Browse files

BUG: Add validity check

In case where the mrml node passed is null, this code crashes.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21552 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information...
1 parent d126a55 commit 795aa7962343d18f0caf278f07d5c2df60308886 @finetjul finetjul committed Dec 31, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 Modules/Loadable/Annotations/Widgets/qMRMLSceneAnnotationModel.cxx
View
5 Modules/Loadable/Annotations/Widgets/qMRMLSceneAnnotationModel.cxx
@@ -320,6 +320,11 @@ vtkMRMLNode* qMRMLSceneAnnotationModel::parentNode(vtkMRMLNode* node)const
vtkMRMLNode* qMRMLSceneAnnotationModel
::activeHierarchyNode(vtkMRMLNode* mrmlNode)const
{
+ if (!mrmlNode)
+ {
+ return 0;
+ }
+
Q_D(const qMRMLSceneAnnotationModel);
if(mrmlNode->IsA("vtkMRMLAnnotationHierarchyNode"))
{

0 comments on commit 795aa79

Please sign in to comment.
Something went wrong with that request. Please try again.