int theIsClear)
{
SMESH_ActorDef* anActor = NULL;
- if(theVisualObj->GetNbEntities(SMDSAbs_Node) > 0 ) {
+ if(theVisualObj->IsValid() ) {
anActor = SMESH_ActorDef::New();
if(!anActor->Init(theVisualObj,theEntry,theName,theIsClear)){
anActor->Delete();
}
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj ));
- if(!CORBA::is_nil(aGroup))
+ if(!CORBA::is_nil(aGroup) && anActor)
{
SALOMEDS::Color aColor = aGroup->GetColor();
if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) )