From: vsr Date: Thu, 22 Nov 2018 12:58:01 +0000 (+0300) Subject: 0023636: EDF 18217 - Problem wen suppressing CAD X-Git-Tag: V9_2_0rc2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=19ea87e9c21929af64f0e91bb146f92c4aa1a23f;hp=96726c1eae9968fd792f9bbe2f03e57a79c13728;p=modules%2Fsmesh.git 0023636: EDF 18217 - Problem wen suppressing CAD - Avoid crash on activating SMESH module after source geometry removal --- diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 69a8f73b0..02d1ad001 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -237,7 +237,8 @@ GEOM::GEOM_Object_ptr SMESH_Gen_i::ShapeToGeomObject (const TopoDS_Shape& theSha if ( aClient && aClient->Find( theShape, IOR )) { CORBA::Object_var obj = GetORB()->string_to_object( IOR.ToCString() ); - aShapeObj = GEOM::GEOM_Object::_narrow ( obj ); + if ( !obj->_non_existent() ) + aShapeObj = GEOM::GEOM_Object::_narrow ( obj ); } } return aShapeObj._retn(); @@ -251,7 +252,7 @@ GEOM::GEOM_Object_ptr SMESH_Gen_i::ShapeToGeomObject (const TopoDS_Shape& theSha TopoDS_Shape SMESH_Gen_i::GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject) { TopoDS_Shape S; - if ( !theGeomObject->_is_nil() ) { + if ( !theGeomObject->_is_nil() && !theGeomObject->_non_existent() ) { GEOM_Client* aClient = GetShapeReader(); GEOM::GEOM_Gen_ptr aGeomEngine = GetGeomEngine(); if ( aClient && !aGeomEngine->_is_nil () )