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:
parent
cdb1621a48
commit
d9d1b23446
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user