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>
This commit is contained in:
Dirk Hohndel 2015-05-17 14:05:24 -07:00
parent 10a0a252c8
commit c11bbe4f38

View file

@ -73,7 +73,10 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo
void LocationInformationWidget::setCurrentDiveSite(int dive_nr)
{
currentDs = get_dive_site(dive_nr);
if (currentDs)
setLocationId(currentDs->uuid);
else
setLocationId(displayed_dive.dive_site_uuid);
}
void LocationInformationWidget::setLocationId(uint32_t uuid)