diff --git a/src/opt/opt_context.cpp b/src/opt/opt_context.cpp index a28500568..b4dbb3dd5 100644 --- a/src/opt/opt_context.cpp +++ b/src/opt/opt_context.cpp @@ -1205,7 +1205,7 @@ namespace opt { } inf_eps context::get_lower_as_num(unsigned idx) { - if (idx > m_objectives.size()) { + if (idx >= m_objectives.size()) { throw default_exception("index out of bounds"); } objective const& obj = m_objectives[idx]; @@ -1223,7 +1223,7 @@ namespace opt { } inf_eps context::get_upper_as_num(unsigned idx) { - if (idx > m_objectives.size()) { + if (idx >= m_objectives.size()) { throw default_exception("index out of bounds"); } objective const& obj = m_objectives[idx];