mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
Fix crash when cancelling 'Add Dive'
If selected_dive is -1 get_dive(selected_dive) will return NULL. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2e43769108
commit
8e8a631cbc
1 changed files with 8 additions and 3 deletions
|
@ -559,9 +559,14 @@ void MainTab::rejectChanges()
|
|||
mydive->weightsystem[i] = notesBackup[mydive].weightsystem[i];
|
||||
}
|
||||
}
|
||||
if (selected_dive > 0) {
|
||||
multiEditEquipmentPlaceholder = *get_dive(selected_dive);
|
||||
cylindersModel->setDive(&multiEditEquipmentPlaceholder);
|
||||
weightModel->setDive(&multiEditEquipmentPlaceholder);
|
||||
} else {
|
||||
cylindersModel->clear();
|
||||
weightModel->clear();
|
||||
}
|
||||
}
|
||||
|
||||
ui.diveNotesMessage->animatedHide();
|
||||
|
|
Loading…
Add table
Reference in a new issue