Salome HOME
getting nb of intersections (non-gui) + add of profiles of stream to tree
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Module.cxx
index 9b1d8f3d5334eead598b93f2ca9c9249ea2b0296..cd5a630bade3cce8eeb1f689d8131f6715a04dae 100644 (file)
@@ -1089,10 +1089,13 @@ void HYDROGUI_Module::setObjectVisible( const int theViewId,
     if ( hydroObject )
     {
         SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( getApp()->objectBrowser()->model() );
-        QString id = hydroObject->text( hydroObject->customData( Qtx::IdType ).toInt() );
-        Qtx::VisibilityState visState = treeModel->visibilityState( id );
-        if ( visState != Qtx::UnpresentableState )
+        if ( treeModel )
+        {
+          QString id = hydroObject->text( hydroObject->customData( Qtx::IdType ).toInt() );
+          Qtx::VisibilityState visState = treeModel->visibilityState( id );
+          if ( visState != Qtx::UnpresentableState )
             treeModel->setVisibilityState( id, theState ? Qtx::ShownState : Qtx::HiddenState );
+        }
     }
 
     if ( theObject->GetKind() == KIND_BATHYMETRY && theState ) {