From: dmv Date: Mon, 22 Mar 2010 12:17:15 +0000 (+0000) Subject: 0020788: EDF 1339 SMESH : Crash after enabling "Auto Color" feature in attached MED... X-Git-Tag: V5_1_4a1~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=736b66759f153dbb56ee53f292c7cbd58192f614;p=modules%2Fsmesh.git 0020788: EDF 1339 SMESH : Crash after enabling "Auto Color" feature in attached MED file --- 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 ); + } } }