Commit 6788223d authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri Committed by Kitware Robot

Merge topic 'algorithm_input_port_warning'

248bf676 Issue error if vtkAlgorithm::GetInputConnection called on wrong port
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Brad King's avatarBrad King <brad.king@kitware.com>
Merge-request: !4705
parents 6fd6d25a 248bf676
......@@ -1413,14 +1413,16 @@ vtkExecutive* vtkAlgorithm::GetInputExecutive(int port, int index)
//----------------------------------------------------------------------------
vtkAlgorithmOutput* vtkAlgorithm::GetInputConnection(int port, int index)
{
if(index < 0 || index >= this->GetNumberOfInputConnections(port))
if(port < 0 || port >= this->GetNumberOfInputPorts())
{
vtkErrorMacro("Attempt to get connection index " << index
<< " for input port " << port << ", for an algorithm with "
<< this->GetNumberOfInputPorts()
<< " ports.");
return nullptr;
}
if (index < 0 || index >= this->GetNumberOfInputConnections(port))
{
#if !defined NDEBUG
vtkWarningMacro("Attempt to get connection index " << index
<< " for input port " << port << ", which has "
<< this->GetNumberOfInputConnections(port)
<< " connections.");
#endif
return nullptr;
}
if(vtkInformation* info =
......
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