From 8a03a5403bc8970c1e8b8604d12cacbc26464ddc Mon Sep 17 00:00:00 2001 From: sln Date: Wed, 24 Aug 2005 13:40:39 +0000 Subject: [PATCH] Verification if ( !aSeq.IsNull() ) added before aLength = aSeq->Length(); string in FindDependances method to avoid exception --- src/SALOMEDS/SALOMEDS_Study.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 1cd52e955..4f202bad9 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -442,9 +442,13 @@ std::vector<_PTR(SObject)> SALOMEDS_Study::FindDependances(const _PTR(SObject)& int aLength, i; if(_isLocal) { Handle(TColStd_HSequenceOfTransient) aSeq = _local_impl->FindDependances(aSO->GetLocalImpl()); - aLength = aSeq->Length(); - for(i=1; i<=aLength; i++) - aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i))))); + if ( !aSeq.IsNull() ) + { + aLength = aSeq->Length(); + for(i=1; i<=aLength; i++) + aVector.push_back(_PTR(SObject)( + new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i))))); + } } else { SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindDependances(aSO->GetCORBAImpl()); -- 2.39.2