diff --git a/treetotableproxymodel.cpp b/treetotableproxymodel.cpp index 3f949d6..9a2fd12 100644 --- a/treetotableproxymodel.cpp +++ b/treetotableproxymodel.cpp @@ -128,6 +128,8 @@ void TreeToTableProxyModel::setSourceModelAndRootIndex(QAbstractItemModel *sourc void TreeToTableProxyModel::setRootIndex(const QModelIndex &index) { + if (!index.isValid()) + return; Q_ASSERT(index.model() == m_sourceModel); beginResetModel();