Skip to content

Commit

Permalink
fix: prevent quickFX model out of bound
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier committed Sep 19, 2024
1 parent 6b4a6f9 commit 51b5d02
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 51b5d02

Please sign in to comment.