From e943d17b2905fb3b509662cda4800f6e5129191d Mon Sep 17 00:00:00 2001 From: Stanislav Bas Date: Sat, 30 May 2015 22:01:21 +0300 Subject: [PATCH] Check for invalid index in IdTable::flags(). This prevents QCompleter from crashes --- apps/opencs/model/world/idtable.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/opencs/model/world/idtable.cpp b/apps/opencs/model/world/idtable.cpp index 04aa271cc..bde6412ec 100644 --- a/apps/opencs/model/world/idtable.cpp +++ b/apps/opencs/model/world/idtable.cpp @@ -84,6 +84,9 @@ bool CSMWorld::IdTable::setData (const QModelIndex &index, const QVariant &value Qt::ItemFlags CSMWorld::IdTable::flags (const QModelIndex & index) const { + if (!index.isValid()) + return 0; + Qt::ItemFlags flags = Qt::ItemIsSelectable | Qt::ItemIsEnabled; if (mIdCollection->getColumn (index.column()).isUserEditable())