summaryrefslogtreecommitdiffstats
path: root/pokemodr/PokemodTreeModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemodr/PokemodTreeModel.cpp')
-rw-r--r--pokemodr/PokemodTreeModel.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/pokemodr/PokemodTreeModel.cpp b/pokemodr/PokemodTreeModel.cpp
index 2844f73f..7acac2cf 100644
--- a/pokemodr/PokemodTreeModel.cpp
+++ b/pokemodr/PokemodTreeModel.cpp
@@ -56,6 +56,8 @@ QModelIndex PokemodTreeModel::index(int row, int /*column*/, const QModelIndex&
if (row < 0)
return createIndex(row, 0, m_root);
BaseModel* object = getItem(parent)->childItem(row);
+ if (!object)
+ qDebug("Creating NULL index!");
return createIndex(row, 0, object);
}
@@ -64,6 +66,8 @@ QModelIndex PokemodTreeModel::parent(const QModelIndex& index) const
if (!index.isValid())
return QModelIndex();
BaseModel* object = static_cast<BaseModel*>(index.internalPointer());
+ if (!object)
+ return QModelIndex();
BaseModel* parent = object->parent();
if (!parent || (parent == m_root))
return QModelIndex();