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.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 213a13d5f..11e84c9c2 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -1263,10 +1263,13 @@ QString DiveItem::displaySac() const
{
QString str;
struct dive *dive = get_dive_by_uniq_id(diveId);
- const char *unit;
- int decimal;
- double value = get_volume_units(dive->sac, &decimal, &unit);
- return QString::number(value, 'f', decimal).append(unit).append(tr("/min"));
+ if (dive->sac) {
+ const char *unit;
+ int decimal;
+ double value = get_volume_units(dive->sac, &decimal, &unit);
+ return QString::number(value, 'f', decimal).append(unit).append(tr("/min"));
+ }
+ return QString("");
}
QString DiveItem::displayWeight() const