diff options
author | Samuel Ghinet <samuel.ghinet@qt.io> | 2023-05-07 09:34:59 +0300 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2023-05-08 01:37:04 +0000 |
commit | 524f45f56685d2931b247f76281d5065e450d186 (patch) | |
tree | a2f16253ec152bae93e83347358bb8ffee25e72e | |
parent | 45599845e82cbc2eba14bf63595f58110b08ecde (diff) | |
download | qt-creator-524f45f56685d2931b247f76281d5065e450d186.tar.gz |
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>
-rw-r--r-- | src/plugins/studiowelcome/stylemodel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/studiowelcome/stylemodel.cpp b/src/plugins/studiowelcome/stylemodel.cpp index d93fc5fded..79669ff2a5 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); |