From 05098f90cd89315a618907038e5e625e767e2b0e Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Tue, 8 Nov 2016 21:17:35 +0100 Subject: 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 Signed-off-by: Dirk Hohndel --- desktop-widgets/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'desktop-widgets') 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; -- cgit v1.2.3-70-g09d2