diff options
Diffstat (limited to 'qt-ui/divepicturewidget.cpp')
-rw-r--r-- | qt-ui/divepicturewidget.cpp | 3 |
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; } |