diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-11-16 22:56:48 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-16 20:33:21 -0800 |
commit | 612c5713b406d0805653234dce63778e92c29c61 (patch) | |
tree | e07fa45963fb2a9b2351c2c54d0da2f8ae61a7d3 /qt-ui/divelistview.cpp | |
parent | 47c833015b28f154e56505a769b6353db613bbc4 (diff) | |
download | subsurface-612c5713b406d0805653234dce63778e92c29c61.tar.gz |
Fix crash when entering a dive via dive-add on a empty table.
We were selecting garbage, not anymore.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r-- | qt-ui/divelistview.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 9f7517308..9779d60e7 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -152,6 +152,8 @@ void DiveListView::unselectDives() void DiveListView::selectDive(int i, bool scrollto, bool toggle) { + if( i == -1) + return; QSortFilterProxyModel *m = qobject_cast<QSortFilterProxyModel*>(model()); QModelIndexList match = m->match(m->index(0,0), DiveTripModel::DIVE_IDX, i, 2, Qt::MatchRecursive); QItemSelectionModel::SelectionFlags flags; |