Skip to content

Commit

Permalink
Merge pull request #13668 from acolombier/fix/qml-quickfx-model
Browse files Browse the repository at this point in the history
fix: prevent quickFX model out of bound
  • Loading branch information
daschuer authored Sep 19, 2024
2 parents 6b4a6f9 + 51b5d02 commit f494727
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/qml/qmlchainpresetmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@ QHash<int, QByteArray> QmlChainPresetModel::roleNames() const {
}

QVariant QmlChainPresetModel::get(int row) const {
QModelIndex idx = index(row, 0);
QVariantMap dataMap;
QModelIndex idx = index(row, 0);

if (!idx.isValid()) {
return dataMap;
}

for (auto it = kRoleNames.constBegin(); it != kRoleNames.constEnd(); it++) {
dataMap.insert(it.value(), data(idx, it.key()));
}
Expand Down

0 comments on commit f494727

Please sign in to comment.