diff options
Diffstat (limited to 'pokemodr/PokemodTreeModel.cpp')
| -rw-r--r-- | pokemodr/PokemodTreeModel.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pokemodr/PokemodTreeModel.cpp b/pokemodr/PokemodTreeModel.cpp index 9c6964ff..03532c40 100644 --- a/pokemodr/PokemodTreeModel.cpp +++ b/pokemodr/PokemodTreeModel.cpp @@ -24,9 +24,6 @@ // Qt includes #include <QMimeData> -// Test code includes -#include <QtDebug> - PokemodTreeModel::PokemodTreeModel(const QStringList& pokemods, QObject* parent) : QAbstractItemModel(parent) { @@ -70,7 +67,7 @@ QModelIndex PokemodTreeModel::parent(const QModelIndex& index) const return QModelIndex(); BaseModel* object = static_cast<BaseModel*>(index.internalPointer()); BaseModel* parent = object->parent(); - if (parent == m_root) + if (!parent || (parent == m_root)) return QModelIndex(); return createIndex(parent->indexNumber(), 0, parent); } |
