summaryrefslogtreecommitdiffstats
path: root/qt-ui/divepicturewidget.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-09 21:15:52 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-09 21:16:34 -0700
commit4029c87ec765dc49ccf2ed97dec1210d70da8014 (patch)
treef1e35ea3be844ab92c1055cd4ed291769a95542a /qt-ui/divepicturewidget.cpp
parentb575069638e21f45d295faaa248e4b057ea89cc0 (diff)
downloadsubsurface-4029c87ec765dc49ccf2ed97dec1210d70da8014.tar.gz
Hide any pictures shown when closing divelog
Fixes #776 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divepicturewidget.cpp')
-rw-r--r--qt-ui/divepicturewidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/divepicturewidget.cpp b/qt-ui/divepicturewidget.cpp
index 03c0321d4..d42afefbf 100644
--- a/qt-ui/divepicturewidget.cpp
+++ b/qt-ui/divepicturewidget.cpp
@@ -44,7 +44,8 @@ void DivePictureModel::updateDivePictures()
endRemoveRows();
}
- numberOfPictures = dive_get_picture_count(&displayed_dive);
+ // if the dive_table is empty, ignore the displayed_dive
+ numberOfPictures = dive_table.nr == 0 ? 0 : dive_get_picture_count(&displayed_dive);
if (numberOfPictures == 0) {
return;
}