mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 19:36:11 +00:00
Fix out of bounds crash in Theme selector (#998)
* Fix out of bounds crash in Theme selectors
This commit is contained in:
parent
bc5d237d9b
commit
4026ea11a1
@ -462,6 +462,14 @@ ColorSettingsModel::ColorSettingsModel(QObject *parent) : QAbstractListModel (pa
|
||||
|
||||
QVariant ColorSettingsModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid()) {
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if (index.row() < 0 || index.row() >= m_data.size()) {
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if (role == Qt::DisplayRole) {
|
||||
return QVariant::fromValue(m_data.at(index.row()).displayingText);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user