diff options
author | Marcos CARDINOT <mcardinot@gmail.com> | 2015-03-20 01:05:41 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-03-20 09:57:53 -0700 |
commit | 056b4baf1190b5300a338a4a0f5bef4b6cedd4b2 (patch) | |
tree | dc012331576a95556715f62e321f5b5fe2cefea7 /qt-ui | |
parent | 70b4c9f2d3c81a5a417ea34d5b43d39aeb5b951a (diff) | |
download | subsurface-056b4baf1190b5300a338a4a0f5bef4b6cedd4b2.tar.gz |
Prevent crash when clicking re-plan without selected dive
test case:
1 - make sure that you DO NOT have anything selected on the 'Dive list;
2 - in the menu bar, click on 'Log'->'Re-plan dive';
3 - crash!
Fixes #858
Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/mainwindow.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 21d36d92f..54c0ce7f2 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -584,9 +584,9 @@ void MainWindow::setupForAddAndPlan(const char *model) void MainWindow::on_actionReplanDive_triggered() { - if (!plannerStateClean()) + if (!plannerStateClean() || !current_dive || !current_dive->dc.model) return; - if (!current_dive || !current_dive->dc.model || strcmp(current_dive->dc.model, "planned dive")) { + else if (strcmp(current_dive->dc.model, "planned dive")) { qDebug() << "trying to replan a dive that's not a planned dive:" << current_dive->dc.model; return; } |