mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +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
7771158c82
commit
6719e45704
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