diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-04-20 10:49:50 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-04-20 10:57:11 -0700 |
commit | ff5c04eb9757ef12d451be2ab0597a88db85c068 (patch) | |
tree | 7c21fdae2e81ee5d2b3952cf7f3afea2f864eb8f | |
parent | abbb0a244d22b9d83ed65496f75f388aea73d999 (diff) | |
download | subsurface-ff5c04eb9757ef12d451be2ab0597a88db85c068.tar.gz |
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>
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 0ce5ef648..506878c98 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -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); } |