mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Fix crash when dives have no dive site
get_dive_site_by_uuid() returns a NULL pointer in that case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
fc56b3c7b5
commit
e20e1aad0e
1 changed files with 5 additions and 4 deletions
|
@ -433,10 +433,11 @@ QStringList DiveObjectHelper::locationList() const
|
|||
struct dive_site *ds;
|
||||
int i = 0;
|
||||
for_each_dive (i, d) {
|
||||
ds = get_dive_site_by_uuid(d->dive_site_uuid);
|
||||
QString temp = ds->name;
|
||||
if (!temp.isEmpty())
|
||||
locations << temp;
|
||||
if ((ds = get_dive_site_by_uuid(d->dive_site_uuid)) != NULL) {
|
||||
QString temp = ds->name;
|
||||
if (!temp.isEmpty())
|
||||
locations << temp;
|
||||
}
|
||||
}
|
||||
locations.removeDuplicates();
|
||||
locations.sort();
|
||||
|
|
Loading…
Reference in a new issue