mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Maintab: prevent a segfault in the 'Equipment' tab
When a dive contains no cylinders, clicking the '+' button could SIGSEGV if current_dive->dc.model 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
a62f68e905
commit
a30a0910b4
1 changed files with 1 additions and 0 deletions
|
@ -223,6 +223,7 @@ void MainTab::enableEdition(EditMode newEditMode)
|
|||
if (current_dive == NULL || editMode != NONE)
|
||||
return;
|
||||
if ((newEditMode == DIVE || newEditMode == NONE) &&
|
||||
current_dive->dc.model &&
|
||||
strcmp(current_dive->dc.model, "manually added dive") == 0) {
|
||||
// editCurrentDive will call enableEdition with newEditMode == MANUALLY_ADDED_DIVE
|
||||
// so exit this function here after editCurrentDive() returns
|
||||
|
|
Loading…
Reference in a new issue