From: rnv Date: Thu, 19 Jan 2017 16:34:04 +0000 (+0300) Subject: Fix crash during GetStudy() for SObject. X-Git-Tag: Before_python3_27062017~1^2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0ac43a662763b9fbfb271b0b127e3e89c837762d;p=modules%2Fkernel.git Fix crash during GetStudy() for SObject. --- diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 3fb21699d..c197b66a6 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -977,7 +977,9 @@ SALOMEDS::Study_ptr SALOMEDS_Study::GetStudy() SALOME_NamingService* namingService = KERNEL::getNamingService(); CORBA::Object_var obj = namingService->Resolve("/Study"); aStudy = SALOMEDS::Study::_narrow(obj); - _local_impl->SetTransientReference(_orb->object_to_string(aStudy)); + if( !CORBA::is_nil( aStudy ) ) { + _local_impl->SetTransientReference(_orb->object_to_string(aStudy)); + } } _corba_impl = SALOMEDS::Study::_duplicate(aStudy); return aStudy._retn();