forked from qt-creator/qt-creator
QmlDesigner: Fix crash at filtering the Style Model in QDS new dialog
Task-number: QDS-9731 Change-Id: Iac64d109fa125f67ab3e713e07ebbc3e519d5ac5 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
45599845e8
commit
524f45f566
@@ -63,6 +63,8 @@ int StyleModel::filteredIndex(int actualIndex)
|
|||||||
if (actualIndex < 0)
|
if (actualIndex < 0)
|
||||||
return actualIndex;
|
return actualIndex;
|
||||||
|
|
||||||
|
QTC_ASSERT(actualIndex < m_items.size(), return -1);
|
||||||
|
|
||||||
QStandardItem *item = m_items.at(actualIndex);
|
QStandardItem *item = m_items.at(actualIndex);
|
||||||
// TODO: perhaps should add this kind of find to utils/algorithm.h
|
// 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);
|
auto it = std::find(std::cbegin(m_filteredItems), std::cend(m_filteredItems), item);
|
||||||
|
|||||||
Reference in New Issue
Block a user