diff options
author | Boris Barbulovski <bbarbulovski@gmail.com> | 2014-02-10 15:59:28 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-10 07:55:55 -0800 |
commit | e7eb06d78cc695bb598a739325225121c8113610 (patch) | |
tree | 7212bd9e5fd89d6ebb5e2b5b1402a397e522b29e /qt-ui/profile/diveplotdatamodel.cpp | |
parent | 3e41047d41388002039f8863b35de3b9bfc30888 (diff) | |
download | subsurface-e7eb06d78cc695bb598a739325225121c8113610.tar.gz |
Improve sanity check for DivePlotDataModel::data()
Adds DivePlotDataModel row upper-boundary check (isValid method already
checks for negative values).
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveplotdatamodel.cpp')
-rw-r--r-- | qt-ui/profile/diveplotdatamodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index cb3b07c50..2f81999c2 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -20,7 +20,7 @@ int DivePlotDataModel::columnCount(const QModelIndex& parent) const QVariant DivePlotDataModel::data(const QModelIndex& index, int role) const { - if (!index.isValid()) + if ((!index.isValid())||(index.row() >= pInfo.nr)) return QVariant(); plot_data item = pInfo.entry[index.row()]; |