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:
Berthold Stoeger 2019-08-13 08:08:34 +02:00 committed by Dirk Hohndel
parent 62cbfc3325
commit 14dd93b655

View file

@ -238,7 +238,7 @@ int DiveListModel::getDiveIdx(int id) 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();
DiveObjectHelper *curr_dive = m_dives[index.row()];