Salome HOME
refs #550: fix crash when myObject is NULL
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Module.cxx
index 4147c74cdeff292c44a0cd479294541245c6dd9b..cbed2b66dc1943b3c443b75712ee31a944c3078e 100644 (file)
@@ -711,13 +711,16 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
 
   if( anIsObjectBrowser && anOwners.size()==1 )
   {
-    Handle( HYDROData_Object ) anObject = Handle( HYDROData_Object )::DownCast( aSeq.First() );
-    if( !anObject.IsNull() )
+    if( aSeq.Size() > 0 )
     {
-      theMenu->addSeparator();
-      theMenu->addAction( action( SubmersibleId ) );
-      action( SubmersibleId )->setCheckable( true );
-      action( SubmersibleId )->setChecked( anObject->IsSubmersible() );
+      Handle( HYDROData_Object ) anObject = Handle( HYDROData_Object )::DownCast( aSeq.First() );
+      if( !anObject.IsNull() )
+      {
+        theMenu->addSeparator();
+        theMenu->addAction( action( SubmersibleId ) );
+        action( SubmersibleId )->setCheckable( true );
+        action( SubmersibleId )->setChecked( anObject->IsSubmersible() );
+      }
     }
   }
 }