Salome HOME
Issue 0020788: EDF 1339 SMESH : Crash after enabling "Auto Color" feature in attached...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_VTKUtils.cxx
index 3841a194ec1b94575f6061bff163e0d4759c2a60..ba884ff79ec7d54310e3c92846e1478ba539a968 100644 (file)
@@ -594,6 +594,8 @@ namespace SMESH
             anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
           else if( aGroup->GetType() == SMESH::EDGE )
             anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
+         else if( aGroup->GetType() == SMESH::ELEM0D )
+           anActor->Set0DColor( aColor.R, aColor.G, aColor.B );
           else
             anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
         }
@@ -712,7 +714,8 @@ namespace SMESH
               _PTR(Study) aDocument = aStudy->studyDS();
               // Pass non-visual objects (hypotheses, etc.), return true in this case
               CORBA::Long anId = aDocument->StudyId();
-              if (TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry))
+              TVisualObjPtr aVisualObj;
+              if ( (aVisualObj = GetVisualObj(anId,theEntry)) && aVisualObj->IsValid())
               {
                 if ((anActor = CreateActor(aDocument,theEntry,true))) {
                   bool needFitAll = noSmeshActors(theWnd); // fit for the first object only