Salome HOME
refs #550: fix crash when myObject is NULL
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Module.cxx
index 1ed020f82b10f099d5e7a64f5dd4d48ca568bdd7..cbed2b66dc1943b3c443b75712ee31a944c3078e 100644 (file)
@@ -573,6 +573,8 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         theMenu->addAction( action( CutImagesId ) );
         theMenu->addAction( action( SplitImageId ) );
         theMenu->addSeparator();
+        theMenu->addAction( action( RecognizeContoursId ) );
+        theMenu->addSeparator();
       }
       else if( anIsBathymetry )
       {
@@ -709,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() );
+      }
     }
   }
 }