diff --git a/src/plugins/studiowelcome/stylemodel.cpp b/src/plugins/studiowelcome/stylemodel.cpp index d93fc5fded2..79669ff2a5f 100644 --- a/src/plugins/studiowelcome/stylemodel.cpp +++ b/src/plugins/studiowelcome/stylemodel.cpp @@ -63,6 +63,8 @@ int StyleModel::filteredIndex(int actualIndex) if (actualIndex < 0) return actualIndex; + QTC_ASSERT(actualIndex < m_items.size(), return -1); + QStandardItem *item = m_items.at(actualIndex); // TODO: perhaps should add this kind of find to utils/algorithm.h auto it = std::find(std::cbegin(m_filteredItems), std::cend(m_filteredItems), item);