summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-08-13 08:08:34 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-08-13 07:27:48 -0700
commit14dd93b655b22ca17cfb041529ae84e91eca4a75 (patch)
treeebcd5ce4f4a35565ff05a39d7a57dc519e79340a /qt-models
parent62cbfc332542b09dc4d7d82f7b1ee61bdde6d800 (diff)
downloadsubsurface-14dd93b655b22ca17cfb041529ae84e91eca4a75.tar.gz
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>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/divelistmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index f85e5e521..72ce90049 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -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()];