mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
70b4c9f2d3
commit
056b4baf11
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue