mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
MainWindow: prevent a possible crash on "re-plan"
MainWindow::on_actionReplanDive_triggered(): If a dive in the divelist does not have a "DC Model" for some reason, selecting "re-plan" from the menu will pass a NULL value current_dive->dc.model to strcmp() and break before the debug output. To fix that we check if the said .model value is NULL. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
71826cf776
commit
341eb05f83
1 changed files with 1 additions and 1 deletions
|
@ -451,7 +451,7 @@ void MainWindow::on_actionReplanDive_triggered()
|
|||
{
|
||||
if (!plannerStateClean())
|
||||
return;
|
||||
if (!current_dive || strcmp(current_dive->dc.model, "planned dive")) {
|
||||
if (!current_dive || !current_dive->dc.model || strcmp(current_dive->dc.model, "planned dive")) {
|
||||
qDebug() << current_dive->dc.model;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue