diff options
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 11 |
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 |