better null checking decklist (#2510)

This commit is contained in:
Zach H 2017-03-18 20:56:49 -04:00 committed by GitHub
parent 3b2eff2551
commit 212a7d00db
2 changed files with 3 additions and 2 deletions

View file

@ -300,8 +300,9 @@ QModelIndex DeckListModel::addCard(const QString &cardName, const QString &zoneN
QModelIndex DeckListModel::nodeToIndex(AbstractDecklistNode *node) const
{
if (node == root)
if (node == nullptr || node == root)
return QModelIndex();
return createIndex(node->getParent()->indexOf(node), 0, node);
}