From: mkr Date: Wed, 13 Jul 2005 11:45:06 +0000 (+0000) Subject: Fix for IPAL9408 : 3.0.0(current3106): CRASH after trying to "Close" saved document... X-Git-Tag: V3_0_1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b2a860d0bbb8c8a98a2ade0a868f697059a36f98;p=modules%2Fkernel.git Fix for IPAL9408 : 3.0.0(current3106): CRASH after trying to "Close" saved document with executed dataflow. --- diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 56c87fc3e..60f8423a8 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -668,12 +668,14 @@ void SALOMEDS_Study_i::RemovePostponed(const CORBA::Long theUndoLimit) int aLegth = aSeq->Length(); for(int i = 1; i <= aLegth; i++) { TCollection_AsciiString anIOR = aSeq->Value(i); - if (anIOR.Value(1) == 'c') { + //mkr : fix for bug IPAL9408 : check the length of anIOR + // before take value from it + if ( !anIOR.IsEmpty() && anIOR.Value(1) == 'c') { CORBA::Object_var obj = _orb->string_to_object(anIOR.Split(1).ToCString()); SALOME::GenericObj_var aGeneric = SALOME::GenericObj::_narrow(obj); if (!CORBA::is_nil(aGeneric)) aGeneric->Destroy(); } - else if (anIOR.Value(1) == 'd') { + else if ( !anIOR.IsEmpty() && anIOR.Value(1) == 'd') { CORBA::Object_var obj = _orb->string_to_object(anIOR.Split(1).ToCString()); SALOME::GenericObj_var aGeneric = SALOME::GenericObj::_narrow(obj); if (!CORBA::is_nil(aGeneric)) aGeneric->Destroy();