summaryrefslogtreecommitdiffstats
path: root/qt-ui/downloadfromdivecomputer.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-09 11:28:15 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-09 11:28:15 -0800
commite9e6e75feb8d4a10f681a2e4435c2bdc97c7c1ea (patch)
tree1f40479847c56b5407f210d3407e073954ff6fb7 /qt-ui/downloadfromdivecomputer.cpp
parent037d1ceefa49bc36edf5a8184e815d8407cef382 (diff)
downloadsubsurface-e9e6e75feb8d4a10f681a2e4435c2bdc97c7c1ea.tar.gz
Dive d/l selection UI: don't setup the model if there are no dives
Setting things up for zero dives will cause all kinds of weird corner cases. Just don't do it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.cpp')
-rw-r--r--qt-ui/downloadfromdivecomputer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index e26ff974c..6700bcdfc 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -403,7 +403,7 @@ void DownloadFromDCWidget::onDownloadThreadFinished()
// down in the dive_table
for (int i = dive_table.nr - 1; i >= previousLast; i--)
delete_single_dive(i);
- } else if (dive_table.nr) {
+ } else if (dive_table.nr && previousLast < dive_table.nr) {
diveImportedModel->setImportedDivesIndexes(previousLast, dive_table.nr - 1);
}
} else if (currentState == CANCELLING || currentState == CANCELLED) {