mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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;
|
struct dive_site *ds;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for_each_dive (i, d) {
|
for_each_dive (i, d) {
|
||||||
ds = get_dive_site_by_uuid(d->dive_site_uuid);
|
if ((ds = get_dive_site_by_uuid(d->dive_site_uuid)) != NULL) {
|
||||||
QString temp = ds->name;
|
QString temp = ds->name;
|
||||||
if (!temp.isEmpty())
|
if (!temp.isEmpty())
|
||||||
locations << temp;
|
locations << temp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
locations.removeDuplicates();
|
locations.removeDuplicates();
|
||||||
locations.sort();
|
locations.sort();
|
||||||
|
|
Loading…
Add table
Reference in a new issue