Fix Icinga when calling array.remove()

fixes #7265
This commit is contained in:
Diana Flach 2019-06-28 16:12:58 +02:00
parent 2f78b67e74
commit ad0ff9839d
1 changed files with 3 additions and 0 deletions

View File

@ -175,6 +175,9 @@ void Array::Remove(SizeType index, bool overrideFrozen)
if (m_Frozen && !overrideFrozen)
BOOST_THROW_EXCEPTION(std::invalid_argument("Array must not be modified."));
if (index >= m_Data.size())
BOOST_THROW_EXCEPTION(std::invalid_argument("Index to remove must be within bounds."));
m_Data.erase(m_Data.begin() + index);
}