mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix crash
With no dive sites we dereference a NULL pointer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f28cec7b9e
commit
96cffe88e7
1 changed files with 7 additions and 2 deletions
|
@ -219,8 +219,13 @@ MainTab::~MainTab()
|
||||||
|
|
||||||
void MainTab::setCurrentLocationIndex()
|
void MainTab::setCurrentLocationIndex()
|
||||||
{
|
{
|
||||||
if (current_dive)
|
if (current_dive) {
|
||||||
ui.location->setCurrentText(get_dive_site_by_uuid(current_dive->dive_site_uuid)->name);
|
struct dive_site *ds = get_dive_site_by_uuid(current_dive->dive_site_uuid);
|
||||||
|
if (ds)
|
||||||
|
ui.location->setCurrentText(ds->name);
|
||||||
|
else
|
||||||
|
ui.location->setCurrentText("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::enableGeoLookupEdition()
|
void MainTab::enableGeoLookupEdition()
|
||||||
|
|
Loading…
Add table
Reference in a new issue