diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-05-17 14:05:24 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-05-17 14:05:24 -0700 |
commit | c11bbe4f3894ec06a79d627c021b05017fd445d0 (patch) | |
tree | 2fea3d8bb9213102ded9bf20c9a15e85295f9415 /qt-ui | |
parent | 10a0a252c826ff3bb8871ff79951d8272132bd08 (diff) | |
download | subsurface-c11bbe4f3894ec06a79d627c021b05017fd445d0.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/locationinformation.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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) |