summaryrefslogtreecommitdiffstats
path: root/common/modelresult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/modelresult.cpp')
-rw-r--r--common/modelresult.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/modelresult.cpp b/common/modelresult.cpp
index 4def20f..e2a05f8 100644
--- a/common/modelresult.cpp
+++ b/common/modelresult.cpp
@@ -100,6 +100,9 @@ QModelIndex ModelResult<T, Ptr>::index(int row, int column, const QModelIndex &p
100template<class T, class Ptr> 100template<class T, class Ptr>
101QModelIndex ModelResult<T, Ptr>::createIndexFromId(const qint64 &id) const 101QModelIndex ModelResult<T, Ptr>::createIndexFromId(const qint64 &id) const
102{ 102{
103 if (id == 0) {
104 return QModelIndex();
105 }
103 auto grandParentId = mParents.value(id, 0); 106 auto grandParentId = mParents.value(id, 0);
104 auto row = mTree.value(grandParentId).indexOf(id); 107 auto row = mTree.value(grandParentId).indexOf(id);
105 return createIndex(row, 0, id); 108 return createIndex(row, 0, id);