Commit 42815afe authored by Sean McBride's avatar Sean McBride

Added vtkErrorMacro to code paths that give null ptrs

Initialize() sets this->Array to null, and that
results in many errors about null derefs.

This doesn’t actually fix those warnings mind you.

Change-Id: I85da8ed1664a6e7dcb1a6c7d987fbfbd309558db
parent d5feacbb
......@@ -246,6 +246,7 @@ unsigned char *vtkBitArray::ResizeAndExtend(vtkIdType sz)
if (newSize <= 0)
{
this->Initialize();
vtkErrorMacro(<< "Memory size must be positive\n");
return 0;
}
......
......@@ -140,6 +140,7 @@ vtkIdType *vtkIdList::Resize(const vtkIdType sz)
if (newSize <= 0)
{
this->Initialize();
vtkErrorMacro(<< "Memory size must be positive\n");
return 0;
}
......
......@@ -339,6 +339,7 @@ vtkStdString * vtkStringArray::ResizeAndExtend(vtkIdType sz)
if(newSize <= 0)
{
this->Initialize();
vtkErrorMacro(<< "Memory size must be positive\n");
return 0;
}
......
......@@ -694,6 +694,7 @@ vtkVariant* vtkVariantArray::ResizeAndExtend(vtkIdType sz)
if(newSize <= 0)
{
this->Initialize();
vtkErrorMacro(<< "Memory size must be positive\n");
return 0;
}
......
......@@ -136,6 +136,7 @@ void** vtkVoidArray::ResizeAndExtend(vtkIdType sz)
if (newSize <= 0)
{
this->Initialize();
vtkErrorMacro(<< "Memory size must be positive\n");
return 0;
}
......
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