diff --git a/protocol/oracle-manager/contracts/nodes/ReducerNode.sol b/protocol/oracle-manager/contracts/nodes/ReducerNode.sol index 63d292c250..23ee385d44 100644 --- a/protocol/oracle-manager/contracts/nodes/ReducerNode.sol +++ b/protocol/oracle-manager/contracts/nodes/ReducerNode.sol @@ -92,7 +92,10 @@ library ReducerNode { function max( NodeOutput.Data[] memory parentNodeOutputs ) internal pure returns (NodeOutput.Data memory maxPrice) { - for (uint256 i = 0; i < parentNodeOutputs.length; i++) { + if (parentNodeOutputs.length > 0) { + maxPrice = parentNodeOutputs[0]; + } + for (uint256 i = 1; i < parentNodeOutputs.length; i++) { if (parentNodeOutputs[i].price > maxPrice.price) { maxPrice = parentNodeOutputs[i]; }