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>
This commit is contained in:
Robert C. Helling 2016-11-08 21:17:35 +01:00 committed by Dirk Hohndel
parent 97be5fda2c
commit 05098f90cd
2 changed files with 12 additions and 8 deletions

View file

@ -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;