From: vsr Date: Thu, 16 Dec 2010 10:19:11 +0000 (+0000) Subject: Fix SIGSEGV in "Mesh Element Info" dialog box if invalid node/element id is printed X-Git-Tag: V6_2_0a2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ee492b84c1697449384e49c9a2993f942111b670;p=modules%2Fsmesh.git Fix SIGSEGV in "Mesh Element Info" dialog box if invalid node/element id is printed --- diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index a40e4676f..15ab58726 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -1454,9 +1454,15 @@ void SMESHGUI_MeshInfoDlg::idChanged() TColStd_MapOfInteger ID; QSet ids; QStringList idTxt = myID->text().split( " ", QString::SkipEmptyParts ); - foreach ( QString id, idTxt ) { - ID.Add( id.trimmed().toLong() ); - ids << id.trimmed().toLong(); + foreach ( QString tid, idTxt ) { + long id = tid.trimmed().toLong(); + const SMDS_MeshElement* e = myMode->checkedId() == ElemMode ? + myActor->GetObject()->GetMesh()->FindElement( id ) : + myActor->GetObject()->GetMesh()->FindNode( id ); + if ( e ) { + ID.Add( id ); + ids << id; + } } selector->AddOrRemoveIndex( IO, ID, false ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )