From 736b66759f153dbb56ee53f292c7cbd58192f614 Mon Sep 17 00:00:00 2001 From: dmv Date: Mon, 22 Mar 2010 12:17:15 +0000 Subject: [PATCH] 0020788: EDF 1339 SMESH : Crash after enabling "Auto Color" feature in attached MED file --- src/SMESHGUI/SMESHGUI.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 602de94d9..bf3c50270 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -684,14 +684,15 @@ aReservedColors.append( aColor ); _PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject); - if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str())) - { - if( aGroupObject->GetType() == SMESH::NODE ) - anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); - else if( aGroupObject->GetType() == SMESH::EDGE ) - anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); - else - anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); + if (aGroupSObject) { + if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str())) { + if( aGroupObject->GetType() == SMESH::NODE ) + anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); + else if( aGroupObject->GetType() == SMESH::EDGE ) + anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); + else + anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); + } } }