]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Protection against aggressive crash when attempting to apply this ExtractCellType...
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 9 Oct 2014 06:47:20 +0000 (08:47 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 9 Oct 2014 06:47:20 +0000 (08:47 +0200)
src/Plugins/MEDReader/ParaViewPlugin/pqExtractCellTypePanel.cxx

index 69c5737438ec8658c59b8d457afb39bd3ecd51e9..28043b79b6db11fb5633376bc2294486d4e2fbeb 100644 (file)
@@ -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<vtkMutableDirectedGraph *>(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();
     }
 }