From 42b62d354b12e4bc2539b381f896cee9d5baced5 Mon Sep 17 00:00:00 2001 From: Tushar Athawale Date: Sun, 13 Feb 2022 09:44:58 -0500 Subject: [PATCH] Error check added for invalid loop indices --- tutorial/extract_edges.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tutorial/extract_edges.cxx b/tutorial/extract_edges.cxx index 0159e7685..5ccf8e381 100644 --- a/tutorial/extract_edges.cxx +++ b/tutorial/extract_edges.cxx @@ -89,9 +89,11 @@ struct EdgeIndicesWorklet : vtkm::worklet::WorkletReduceByKey auto cellShape = cellSet.GetCellShape(originCells[0]); vtkm::IdComponent pointInCellIndex0; - vtkm::exec::CellEdgeLocalIndex(numPointsInCell, 0, edgeIndex, cellShape, pointInCellIndex0); + VTKM_RETURN_ON_ERROR( + vtkm::exec::CellEdgeLocalIndex(numPointsInCell, 0, edgeIndex, cellShape, pointInCellIndex0)); vtkm::IdComponent pointInCellIndex1; - vtkm::exec::CellEdgeLocalIndex(numPointsInCell, 1, edgeIndex, cellShape, pointInCellIndex1); + VTKM_RETURN_ON_ERROR( + vtkm::exec::CellEdgeLocalIndex(numPointsInCell, 1, edgeIndex, cellShape, pointInCellIndex1)); auto globalPointIndicesForCell = cellSet.GetIndices(originCells[0]); connectivityOut[0] = globalPointIndicesForCell[pointInCellIndex0];