diff --git a/src/SMESHGUI/SMESHGUI_Filter.cxx b/src/SMESHGUI/SMESHGUI_Filter.cxx index 08da7c923..52f36378b 100755 --- a/src/SMESHGUI/SMESHGUI_Filter.cxx +++ b/src/SMESHGUI/SMESHGUI_Filter.cxx @@ -83,8 +83,8 @@ bool SMESHGUI_PredicateFilter::IsValid( const int theCellId ) const if ( myActor == 0 || myPred->_is_nil() ) return false; - SMESH_Actor* anActor = ( SMESH_Actor* )myActor; - if ( anActor->GetObject() == 0 ) + SMESH_Actor* anActor = dynamic_cast( myActor ); + if ( !anActor || anActor->GetObject() == 0 ) return false; SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();