diff options
author | Robert C. Helling <helling@atdotde.de> | 2016-11-08 21:17:35 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-11-09 06:25:11 -0800 |
commit | 05098f90cd89315a618907038e5e625e767e2b0e (patch) | |
tree | fdd74d471f76e7f886c3d339f850eb8fb78b7030 /desktop-widgets | |
parent | 97be5fda2c9ed3cf135c31a0e2c77107ab2d7eb1 (diff) | |
download | subsurface-05098f90cd89315a618907038e5e625e767e2b0e.tar.gz |
Use fake profile when replanning dives without samples
This can happen when the user asks to replan a dive that
was imported from CSV.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 33151efb8..e1ef641dc 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -903,9 +903,9 @@ void MainWindow::setupForAddAndPlan(const char *model) void MainWindow::on_actionReplanDive_triggered() { - if (!plannerStateClean() || !current_dive || !current_dive->dc.model) + if (!plannerStateClean() || !current_dive) return; - else if (strcmp(current_dive->dc.model, "planned dive")) { + else if (!current_dive->dc.model || strcmp(current_dive->dc.model, "planned dive")) { if (QMessageBox::warning(this, tr("Warning"), tr("Trying to replan a dive that's not a planned dive."), QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel) return; |