Commit 43a9b051 authored by Cory Quammen's avatar Cory Quammen

Added checking for NULL pointer in a few locations

Also added missing print out of member variable.

Change-Id: I9ea62ea7c60545fa2a6a5552c8dd8b98d2fdd093
parent 0c29a735
......@@ -36,7 +36,10 @@ vtkPolyLineSource::vtkPolyLineSource()
//----------------------------------------------------------------------------
vtkPolyLineSource::~vtkPolyLineSource()
{
this->Points->Delete();
if (this->Points)
{
this->Points->Delete();
}
}
//----------------------------------------------------------------------------
......@@ -60,7 +63,12 @@ void vtkPolyLineSource::SetNumberOfPoints(vtkIdType numPoints)
//----------------------------------------------------------------------------
vtkIdType vtkPolyLineSource::GetNumberOfPoints()
{
return this->Points->GetNumberOfPoints();
if (this->Points)
{
return this->Points->GetNumberOfPoints();
}
return 0;
}
//----------------------------------------------------------------------------
......@@ -139,4 +147,5 @@ void vtkPolyLineSource::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os, indent);
os << indent << "Points: " << this->Points << "\n";
os << indent << "Closed: " << this->Closed << "\n";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment