]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
fix bug 12361. Peview possiblity of SetCurrentStudy(nil)
authoreap <eap@opencascade.com>
Wed, 10 May 2006 12:49:13 +0000 (12:49 +0000)
committereap <eap@opencascade.com>
Wed, 10 May 2006 12:49:13 +0000 (12:49 +0000)
src/SMESH_I/SMESH_Gen_i.cxx

index 93d657e2098ca8a73bffbd7fa6af4bf81bc1489a..b77a987737f0299b7cbda661db1fc491c5763a7b 100644 (file)
@@ -456,13 +456,16 @@ void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy )
     myStudyContextMap[ studyId ] = new StudyContext;      
   }
 
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); 
-  if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() )
-    aStudyBuilder->LoadWith( myCurrentStudy->FindComponent( "GEOM" ), GetGeomEngine() );
+  // myCurrentStudy may be nil
+  if ( !CORBA::is_nil( myCurrentStudy ) ) {
+    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); 
+    if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() )
+      aStudyBuilder->LoadWith( myCurrentStudy->FindComponent( "GEOM" ), GetGeomEngine() );
 
   // set current study for geom engine
   //if ( !CORBA::is_nil( GetGeomEngine() ) )
   //  GetGeomEngine()->GetCurrentStudy( myCurrentStudy->StudyId() );
+  }
 }
 
 //=============================================================================