mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 06:17:46 +02:00
Fix ScriptDiscoveryService.scriptsModel.data() crash for invalid row
Also fixes unexpected data for invalid column > 1.
This commit is contained in:
parent
ccfd3e2fb1
commit
757a4f908b
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ TreeNodeBase* ScriptsModel::getTreeNodeFromIndex(const QModelIndex& index) const
|
|||
}
|
||||
|
||||
QModelIndex ScriptsModel::index(int row, int column, const QModelIndex& parent) const {
|
||||
if (row < 0 || column < 0) {
|
||||
if (row < 0 || row >= rowCount(parent) || column < 0 || column >= columnCount(parent)) {
|
||||
return QModelIndex();
|
||||
}
|
||||
return createIndex(row, column, getFolderNodes(static_cast<TreeNodeFolder*>(getTreeNodeFromIndex(parent))).at(row));
|
||||
|
|
Loading…
Reference in a new issue