From ff5c08fcc5489b7f89257453ff19fedd76e66f81 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Thu, 9 Oct 2014 08:47:20 +0200 Subject: [PATCH] Protection against aggressive crash when attempting to apply this ExtractCellType filter on non unstructured mesh. --- .../ParaViewPlugin/pqExtractCellTypePanel.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Plugins/MEDReader/ParaViewPlugin/pqExtractCellTypePanel.cxx b/src/Plugins/MEDReader/ParaViewPlugin/pqExtractCellTypePanel.cxx index 69c57374..28043b79 100644 --- a/src/Plugins/MEDReader/ParaViewPlugin/pqExtractCellTypePanel.cxx +++ b/src/Plugins/MEDReader/ParaViewPlugin/pqExtractCellTypePanel.cxx @@ -89,6 +89,8 @@ pqExtractCellTypePanel::pqExtractCellTypePanel(pqProxy* object_proxy, QWidget* p vtkGraph *g(info->GetSIL()); //vtkMutableDirectedGraph *g2(vtkMutableDirectedGraph::SafeDownCast(g));// agy: this line does not work in client/server mode ! but it works in standard mode ! Don't know why. ParaView bug ? vtkMutableDirectedGraph *g2(static_cast(g)); + if(!g2) + return ; int idNames(0); vtkAbstractArray *verticesNames(g2->GetVertexData()->GetAbstractArray("Names",idNames)); vtkStringArray *verticesNames2(vtkStringArray::SafeDownCast(verticesNames)); @@ -156,8 +158,12 @@ void pqExtractCellTypePanel::updateSIL() this->UI->SILUpdateStamp = stamp; vtkPVSILInformation* info = vtkPVSILInformation::New(); reader->GatherInformation(info); - this->UI->SILModel.update(info->GetSIL()); - this->UI->Fields->expandAll(); + vtkGraph *sil(info->GetSIL()); + if(sil) + { + this->UI->SILModel.update(sil); + this->UI->Fields->expandAll(); + } info->Delete(); } } -- 2.39.2