From c11bbe4f3894ec06a79d627c021b05017fd445d0 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 17 May 2015 14:05:24 -0700 Subject: Fix easily reproduced crash Open dive file. Click Location-manage. Pick a site. Click close. Click Location-manage again. BOOM. This seems to make sense, but since not a lot of the code is hooked up yet, I'm not sure this is what we want in the end. But for now it prevents an easily reproduced crash. Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 812666737..18f780983 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -73,7 +73,10 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo void LocationInformationWidget::setCurrentDiveSite(int dive_nr) { currentDs = get_dive_site(dive_nr); - setLocationId(currentDs->uuid); + if (currentDs) + setLocationId(currentDs->uuid); + else + setLocationId(displayed_dive.dive_site_uuid); } void LocationInformationWidget::setLocationId(uint32_t uuid) -- cgit v1.2.3-70-g09d2