summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-04-20 10:49:50 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-04-20 10:57:11 -0700
commitff5c04eb9757ef12d451be2ab0597a88db85c068 (patch)
tree7c21fdae2e81ee5d2b3952cf7f3afea2f864eb8f /desktop-widgets/mainwindow.cpp
parentabbb0a244d22b9d83ed65496f75f388aea73d999 (diff)
downloadsubsurface-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>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp3
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);
}