Do not abort when there is no current dive

Yes, currentdive can be undefined in case of of a new logbook and starting the planner
right away. Do not abort on that.

Reported-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2017-04-20 10:49:50 +02:00 committed by Dirk Hohndel
parent abbb0a244d
commit ff5c04eb97

View file

@ -953,7 +953,8 @@ void MainWindow::on_actionDivePlanner_triggered()
DivePlannerPointsModel::instance()->setupStartTime();
DivePlannerPointsModel::instance()->createSimpleDive();
// plan the dive in the same mode as the currently selected one
divePlannerSettingsWidget()->setDiveMode(current_dive->dc.divemode);
if (current_dive)
divePlannerSettingsWidget()->setDiveMode(current_dive->dc.divemode);
DivePictureModel::instance()->updateDivePictures();
divePlannerWidget()->setReplanButton(false);
}