summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2016-11-08 21:17:35 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-11-09 06:25:11 -0800
commit05098f90cd89315a618907038e5e625e767e2b0e (patch)
treefdd74d471f76e7f886c3d339f850eb8fb78b7030 /desktop-widgets
parent97be5fda2c9ed3cf135c31a0e2c77107ab2d7eb1 (diff)
downloadsubsurface-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.cpp4
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;