diff options
Diffstat (limited to 'qt-ui/simplewidgets.cpp')
-rw-r--r-- | qt-ui/simplewidgets.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index 00f749780..4f050063c 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -666,7 +666,10 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo void LocationInformationWidget::setLocationId(uint32_t uuid) { currentDs = get_dive_site_by_uuid(uuid); - displayed_dive_site = *currentDs; + if (currentDs) + displayed_dive_site = *currentDs; + else + memset(&displayed_dive, 0, sizeof(displayed_dive)); ui.diveSiteName->setText(displayed_dive_site.name); ui.diveSiteDescription->setText(displayed_dive_site.description); ui.diveSiteNotes->setPlainText(displayed_dive_site.notes); |