mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
3e41047d41
commit
e7eb06d78c
1 changed files with 1 additions and 1 deletions
|
@ -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()];
|
||||
|
|
Loading…
Add table
Reference in a new issue