From 632555fa71ccf511ac5e94dc42666af9c4e374a8 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sat, 17 Dec 2022 16:39:02 +0100 Subject: [PATCH] Fixed strange crash with invalid model index --- treetotableproxymodel.cpp | 2 ++ 1 file changed, 2 insertions(+) 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();