summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 2a0f9e98e..d0c244917 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -929,7 +929,10 @@ QVariant TripItem::data(int column, int role) const
if (role == Qt::DisplayRole) {
switch (column) {
case DiveTripModel::NR:
- ret = QString(trip->location) + ", " + get_trip_date_string(trip->when, trip->nrdives);
+ if (trip->location && *trip->location)
+ ret = QString(trip->location) + ", " + get_trip_date_string(trip->when, trip->nrdives);
+ else
+ ret = get_trip_date_string(trip->when, trip->nrdives);
break;
}
}