STYLE: paraview reader attempts to shallow copy nullptr (closes #586)

- Can occur if the selected geometry does not actually exist.
  A non-critical bug since paraview catches this anyhow and
  just emits a warning message.
This commit is contained in:
Mark Olesen
2017-09-12 15:42:10 +02:00
parent 05aa701c15
commit 2cfc88fa03

View File

@ -155,7 +155,10 @@ class vtkPVFoam
vtkSmartPointer<dataType> getCopy() const vtkSmartPointer<dataType> getCopy() const
{ {
auto copy = vtkSmartPointer<dataType>::New(); auto copy = vtkSmartPointer<dataType>::New();
copy->ShallowCopy(vtkgeom); if (vtkgeom)
{
copy->ShallowCopy(vtkgeom);
}
return copy; return copy;
} }
@ -163,7 +166,10 @@ class vtkPVFoam
void reuse() void reuse()
{ {
dataset = vtkSmartPointer<dataType>::New(); dataset = vtkSmartPointer<dataType>::New();
dataset->ShallowCopy(vtkgeom); if (vtkgeom)
{
dataset->ShallowCopy(vtkgeom);
}
} }
//- Set the geometry and make a shallow copy to dataset //- Set the geometry and make a shallow copy to dataset