Skip to content
Snippets Groups Projects
Commit b7c38121 authored by Andreas Schenk's avatar Andreas Schenk Committed by BIOPZ-Johner Niklaus
Browse files

testing for valid model index before creating new index in SceneWinModel

parent b9ec8fcb
No related branches found
No related tags found
No related merge requests found
...@@ -114,6 +114,9 @@ void SceneWinModel::Update() ...@@ -114,6 +114,9 @@ void SceneWinModel::Update()
QModelIndex SceneWinModel::index(int row, int col, QModelIndex SceneWinModel::index(int row, int col,
const QModelIndex& parent) const const QModelIndex& parent) const
{ {
if (!hasIndex(row, col, parent)){
return QModelIndex();
}
SceneNode* parent_node = GetItem(parent); SceneNode* parent_node = GetItem(parent);
if (parent_node->children().size() <= row) if (parent_node->children().size() <= row)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment