forked from qt-creator/qt-creator
CppEditor: Check model index in ParseContextModel::data
Task-number: QTCREATORBUG-22596 Change-Id: I6babbab8fc9c66ca6d16fe60d93bfbc9147ead90 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -118,7 +118,7 @@ int ParseContextModel::rowCount(const QModelIndex &) const
|
||||
|
||||
QVariant ParseContextModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (m_projectParts.isEmpty())
|
||||
if (!index.isValid() || index.row() < 0 || index.row() >= m_projectParts.size())
|
||||
return QVariant();
|
||||
|
||||
const int row = index.row();
|
||||
|
||||
Reference in New Issue
Block a user