mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 04:33:24 +00:00
Fix crash when adding a dive
If a dive has no dive_site_uuid we would dereference a NULL pointer and crash. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
da60867ae3
commit
b60b4ef69d
1 changed files with 4 additions and 1 deletions
|
@ -666,7 +666,10 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo
|
|||
void LocationInformationWidget::setLocationId(uint32_t uuid)
|
||||
{
|
||||
currentDs = get_dive_site_by_uuid(uuid);
|
||||
displayed_dive_site = *currentDs;
|
||||
if (currentDs)
|
||||
displayed_dive_site = *currentDs;
|
||||
else
|
||||
memset(&displayed_dive, 0, sizeof(displayed_dive));
|
||||
ui.diveSiteName->setText(displayed_dive_site.name);
|
||||
ui.diveSiteDescription->setText(displayed_dive_site.description);
|
||||
ui.diveSiteNotes->setPlainText(displayed_dive_site.notes);
|
||||
|
|
Loading…
Add table
Reference in a new issue