aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 1a024686b..a4b9a55ff 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -656,9 +656,10 @@ MainTab::EditMode MainTab::getEditMode() const
void MainTab::refreshDisplayedDiveSite()
{
- if (displayed_dive_site.uuid) {
- copy_dive_site(get_dive_site_by_uuid(displayed_dive_site.uuid), &displayed_dive_site);
- ui.location->setCurrentDiveSiteUuid(displayed_dive_site.uuid);
+ struct dive_site *ds = get_dive_site_for_dive(&displayed_dive);
+ if (ds) {
+ copy_dive_site(ds, &displayed_dive_site);
+ ui.location->setCurrentDiveSiteUuid(ds->uuid);
}
}