Salome HOME
patch for regression in popup menu construction
authorasl <asl@opencascade.com>
Mon, 25 May 2015 11:57:25 +0000 (14:57 +0300)
committerasl <asl@opencascade.com>
Mon, 25 May 2015 11:57:25 +0000 (14:57 +0300)
src/HYDROGUI/HYDROGUI_Module.cxx

index 1ed020f82b10f099d5e7a64f5dd4d48ca568bdd7..283f361e77034b025de0ec4630f6b5fc4f06ba64 100644 (file)
@@ -709,13 +709,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() );
+      }
     }
   }
 }