bool GEOMGUI_Selection::hasChildren( const _PTR(SObject)& obj )
{
- // as soon as Use Case browser data tree was added
- return obj->GetStudy()->GetUseCaseBuilder()->HasChildren( obj );
+ if ( obj ) {
+ // as soon as Use Case browser data tree was added
+ return obj->GetStudy()->GetUseCaseBuilder()->HasChildren( obj );
+ }
}
bool GEOMGUI_Selection::expandable( const _PTR(SObject)& obj )
{
bool ret = false;
_PTR(GenericAttribute) anAttr;
- if ( obj->FindAttribute(anAttr, "AttributeLocalID") ) {
+ if ( obj && obj->FindAttribute(anAttr, "AttributeLocalID") ) {
_PTR(AttributeLocalID) aLocalID( anAttr );
ret = aLocalID->Value() == 999;
}
_PTR(Study) study = appStudy->studyDS();
if ( study && !anEntry.isEmpty() ) {
_PTR(SObject) aSO( study->FindObjectID( anEntry.toStdString() ) );
- if ( aSO->GetStudy()->GetUseCaseBuilder()->IsUseCaseNode(aSO) ) {
+ if ( aSO && aSO->GetStudy()->GetUseCaseBuilder()->IsUseCaseNode(aSO) ) {
_PTR(UseCaseIterator) it = aSO->GetStudy()->GetUseCaseBuilder()->GetUseCaseIterator( aSO );
for (it->Init(false); it->More(); it->Next()) nb++;
}