From: kga Date: Tue, 22 Oct 2013 09:27:12 +0000 (+0000) Subject: Fix crash on Python Dump if some object has been deleted X-Git-Tag: BR_hydro_v_0_3_1~73 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=52074fe3dd116aa22bd4de0e954b9076fce53946;p=modules%2Fgeom.git Fix crash on Python Dump if some object has been deleted --- diff --git a/src/GEOM_I/GEOM_DumpPython.cc b/src/GEOM_I/GEOM_DumpPython.cc index 40a9ad679..c5f443082 100644 --- a/src/GEOM_I/GEOM_DumpPython.cc +++ b/src/GEOM_I/GEOM_DumpPython.cc @@ -173,6 +173,8 @@ Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy, CORBA::String_var anEntry = CORBA::string_dup(newEntry.c_str()); if( ap->IsSet(anEntry, 6) ) { //6 Means string array, see SALOMEDS_Attributes.idl AttributeParameter interface + if ( GetDumpName((*it)._studyEntry.ToCString()) == NULL ) + continue; std::string idCommand = std::string("geompy.getObjectID(") + GetDumpName((*it)._studyEntry.ToCString()) + std::string(")"); SALOMEDS::StringSeq_var aSeq= ap->GetStrArray(anEntry); int oldLenght = aSeq->length(); @@ -230,6 +232,8 @@ Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy, } else if ( !aFatherName.IsEmpty() && !aFatherEntry.IsEmpty() ) { // the node is Geom object under folder aDirScript += "geompy.PutToFolder("; + if ( GetDumpName( aNodeSO->GetID() ) == NULL ) + continue; aDirScript += GetDumpName( aNodeSO->GetID() ); aDirScript += ", "; aDirScript += aFatherName;