diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-12-28 19:20:04 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-29 09:14:20 -0800 |
commit | 686544bcefc4d26a7b16d2db0ee998d61e1c9a4c (patch) | |
tree | 25f1d67ed51949c7b77b5da31d1e417551500bd2 | |
parent | 2fb5a7d08274445347e13e99d76afdb2888c0852 (diff) | |
download | subsurface-686544bcefc4d26a7b16d2db0ee998d61e1c9a4c.tar.gz |
cleanup: Improper use of negative value
CID 45112
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
-rw-r--r-- | desktop-widgets/undocommands.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/desktop-widgets/undocommands.cpp b/desktop-widgets/undocommands.cpp index e1852832d..de3c01cff 100644 --- a/desktop-widgets/undocommands.cpp +++ b/desktop-widgets/undocommands.cpp @@ -62,7 +62,9 @@ void UndoDeleteDive::redo() tripList.append(undo_trip); } //delete the dive - delete_single_dive(get_divenr(diveList.at(i))); + int nr; + if ((nr = get_divenr(diveList.at(i))) >= 0) + delete_single_dive(nr); } mark_divelist_changed(true); MainWindow::instance()->refreshDisplay(); |