summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2021-07-03 14:41:55 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-07-03 14:38:19 -0700
commit6b2e56e5131aa707216c4b0da5805199fcc0034d (patch)
treeffd55dc118ab337822ed78653122079619b62d9e /desktop-widgets/mainwindow.cpp
parent876a09753aa25400d795c97498e0e9bb50489fda (diff)
downloadsubsurface-6b2e56e5131aa707216c4b0da5805199fcc0034d.tar.gz
Handle dives with no samples
This occurs upon importing dives for example via CSV. Make sure the profile display is cleared when selecting such a dive rather than showing a different dive. Allow editing the profile for such a dive. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index fd4fe8f82..35140ffbf 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -1512,7 +1512,7 @@ void MainWindow::on_actionImportDiveSites_triggered()
void MainWindow::editCurrentDive()
{
// We only allow editing of the profile for manually added dives.
- if (!current_dive || !same_string(current_dive->dc.model, "manually added dive") || !userMayChangeAppState())
+ if (!current_dive || (!same_string(current_dive->dc.model, "manually added dive") && current_dive->dc.samples) || !userMayChangeAppState())
return;
// This shouldn't be possible, but let's make sure no weird "double editing" takes place.