From: eap Date: Wed, 10 May 2006 12:49:13 +0000 (+0000) Subject: fix bug 12361. Peview possiblity of SetCurrentStudy(nil) X-Git-Tag: T3_2_0b1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=fdfe9f0f6571fbb22a5595e86c93127dfa88c7ca fix bug 12361. Peview possiblity of SetCurrentStudy(nil) --- diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 93d657e20..b77a98773 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -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() ); + } } //=============================================================================