mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile: fix bound check in DiveListModel::data()
Indexes go from 0 to count - 1. Thus, the comparison for invalid indexes has to read ">= count", not "> count". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
62cbfc3325
commit
14dd93b655
1 changed files with 1 additions and 1 deletions
|
@ -238,7 +238,7 @@ int DiveListModel::getDiveIdx(int id) const
|
||||||
|
|
||||||
QVariant DiveListModel::data(const QModelIndex &index, int role) const
|
QVariant DiveListModel::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
if(index.row() < 0 || index.row() > m_dives.count())
|
if(index.row() < 0 || index.row() >= m_dives.count())
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
DiveObjectHelper *curr_dive = m_dives[index.row()];
|
DiveObjectHelper *curr_dive = m_dives[index.row()];
|
||||||
|
|
Loading…
Add table
Reference in a new issue