summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/TabDivePhotos.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/tab-widgets/TabDivePhotos.cpp')
-rw-r--r--desktop-widgets/tab-widgets/TabDivePhotos.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/desktop-widgets/tab-widgets/TabDivePhotos.cpp b/desktop-widgets/tab-widgets/TabDivePhotos.cpp
index db1b943e4..03351184f 100644
--- a/desktop-widgets/tab-widgets/TabDivePhotos.cpp
+++ b/desktop-widgets/tab-widgets/TabDivePhotos.cpp
@@ -111,6 +111,8 @@ void TabDivePhotos::recalculateSelectedThumbnails()
void TabDivePhotos::saveSubtitles()
{
+ if (!current_dive)
+ return;
if (!ui->photosView->selectionModel()->hasSelection())
return;
QModelIndexList indices = ui->photosView->selectionModel()->selectedRows();
@@ -127,7 +129,7 @@ void TabDivePhotos::saveSubtitles()
if (!duration)
continue;
struct membuffer b = { 0 };
- save_subtitles_buffer(&b, &displayed_dive, offset, duration);
+ save_subtitles_buffer(&b, current_dive, offset, duration);
char *data = detach_cstring(&b);
subtitlefile.open(QIODevice::WriteOnly);
subtitlefile.write(data, strlen(data));