 //----------------------------------------------------------------------------
 void PyFRConverter::operator ()(const PyFRContourData* pyfrContourData,vtkPolyData* outPolyData) const
 {
+  if (pyfrContourData->GetNumberOfContours() == 0)
+    {
+    return;
+    }
+
   vtkSmartPointer<vtkAppendPolyData> appendFilter =
     vtkSmartPointer<vtkAppendPolyData>::New();
   appendFilter->SetOutput(outPolyData);

  for (vtkIdType i=0;i<points->GetNumberOfPoints();i+=3)
    {
    for (vtkIdType j=0;j<3;j++)
      indices[j] = i+j;
    polys->InsertNextCell(3,indices);
    }


  grid->Allocate(connectivity.GetNumberOfValues()/8);
  grid->SetPoints(points);
  for (unsigned i=0;i<5;i++)
    {
    grid->GetPointData()->AddArray(solutionData[i]);
    }
  vtkIdType counter = 0;
  while (counter < connectivity.GetNumberOfValues())
    {
    vtkSmartPointer<vtkHexahedron> hex = vtkSmartPointer<vtkHexahedron>::New();
    for (vtkIdType j=0;j<8;j++)
      {
      hex->GetPointIds()->SetId(j,portal.Get(counter++));
      }
    grid->InsertNextCell(hex->GetCellType(),hex->GetPointIds());
    }
}
