Hide any pictures shown when closing divelog

Fixes #776

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-12-09 21:15:52 -07:00
parent b575069638
commit 4029c87ec7
2 changed files with 4 additions and 1 deletions

View file

@ -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;
}