vtkImageData::GetScalarPointer() calls abort
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
The function vtkImageData::GetScalarPointer calls abort:
void *vtkImageData::GetScalarPointer() { if (this->PointData->GetScalars() == NULL) { vtkDebugMacro("Allocating scalars in ImageData"); abort(); //this->AllocateScalars(); } return this->PointData->GetScalars()->GetVoidPointer(0); }
I think this is a bug for any library to call abort, since it cannot be gracefully caught/handled by the application. In addition this is inconsistent with the other versions of GetScalarPointer, which take arguments.
I would suggest to return NULL if there are no scalars. Thanks, Bryn