From ad82b876016367bd9765185dba84600985e5d0fd Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Fri, 18 Mar 2022 10:14:28 +0500 Subject: [PATCH] Fix crash with stale indexes BUG: 451593 --- src/completion/katecompletionmodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/completion/katecompletionmodel.cpp b/src/completion/katecompletionmodel.cpp index 1e241f0d..d9bb8421 100644 --- a/src/completion/katecompletionmodel.cpp +++ b/src/completion/katecompletionmodel.cpp @@ -914,6 +914,11 @@ QModelIndex KateCompletionModel::mapToSource(const QModelIndex &proxyIndex) cons } if (Group *g = groupOfParent(proxyIndex)) { + if (!m_rowTable.contains(g)) { + qWarning() << Q_FUNC_INFO << "Stale proxy index for which there is no group"; + return {}; + } + if (proxyIndex.row() >= 0 && proxyIndex.row() < (int)g->filtered.size()) { ModelRow source = g->filtered[proxyIndex.row()].sourceRow(); return source.second.sibling(source.second.row(), proxyIndex.column()); -- GitLab