Commit b4f82d8e authored by Aashish Chaudhary's avatar Aashish Chaudhary

BUG: Fixed the crash when edge data array is set but not found.

This could also happen when the array is not a data array.
parent af651d2e
......@@ -100,6 +100,13 @@ int vtkBoostBrandesCentrality::RequestData(
vtkDataArray* weights =
input->GetEdgeData()->GetArray(this->EdgeWeightArrayName);
if(!weights)
{
vtkErrorMacro(<<"Error: Edge weight array " << this->EdgeWeightArrayName
<< " is set but not found or not a data array.\n");
return 0;
}
edgeWeight.TakeReference(
vtkDataArray::CreateDataArray(weights->GetDataType()));
......@@ -120,7 +127,7 @@ int vtkBoostBrandesCentrality::RequestData(
if(!edgeWeight)
{
vtkErrorMacro(<<"Error: Edge weight array " << this->EdgeWeightArrayName
<< " is set but not found.\n");
<< " is set but not found or not a data array.\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