From 686544bcefc4d26a7b16d2db0ee998d61e1c9a4c Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Thu, 28 Dec 2017 19:20:04 +0100 Subject: cleanup: Improper use of negative value CID 45112 Signed-off-by: Jan Mulder --- desktop-widgets/undocommands.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3-70-g09d2