summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-models/divepicturemodel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-models/divepicturemodel.cpp b/qt-models/divepicturemodel.cpp
index 47e64492b..ef60001b4 100644
--- a/qt-models/divepicturemodel.cpp
+++ b/qt-models/divepicturemodel.cpp
@@ -108,8 +108,10 @@ void DivePictureModel::updateDivePictures()
updateThumbnails();
- beginInsertRows(QModelIndex(), 0, pictures.count() - 1);
- endInsertRows();
+ if (!pictures.isEmpty()) {
+ beginInsertRows(QModelIndex(), 0, pictures.count() - 1);
+ endInsertRows();
+ }
}
int DivePictureModel::columnCount(const QModelIndex &parent) const