1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Add range check

This commit is contained in:
kelteseth 2017-12-14 14:08:03 +01:00
parent cdb1621a48
commit d9d1b23446
3 changed files with 14 additions and 0 deletions

View File

@ -15,6 +15,11 @@ QVariant InstalledListModel::data(const QModelIndex& index, int role) const
if (!index.isValid())
return QVariant();
int row = index.row();
if(row < 0 || row >= m_screenPlayFiles.count()) {
return QVariant();
}
if (index.row() < rowCount())
switch (role) {
case TitleRole:

View File

@ -57,6 +57,11 @@ QVariant MonitorListModel::data(const QModelIndex& index, int role) const
if (!index.isValid())
return QVariant();
int row = index.row();
if(row < 0 || row >= m_monitorList.count()) {
return QVariant();
}
if (index.row() < rowCount())
switch (role) {
case IDRole:

View File

@ -28,6 +28,10 @@ QVariant ProfileListModel::data(const QModelIndex& index, int role) const
return QVariant();
int row = index.row();
if(row < 0 || row >= m_profileList.count()) {
return QVariant();
}
if (row < 0 || row >= m_profileList.count()) {
return QVariant();
}