aboutsummaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/DiveObjectHelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/subsurface-qt/DiveObjectHelper.cpp')
-rw-r--r--core/subsurface-qt/DiveObjectHelper.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp
index 7a3767409..8ea8b6370 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -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();