From 0ac43a662763b9fbfb271b0b127e3e89c837762d Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 19 Jan 2017 19:34:04 +0300 Subject: [PATCH] Fix crash during GetStudy() for SObject. --- src/SALOMEDS/SALOMEDS_Study.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.39.2