Desktop: do not crash in verbose mode on empty dive site

Import dives from a DC, and have ssrf started in verbose mode. After
downloading dives, hit ok, to add them to the dive list. This crashes
as we cannot get the uuid from the null dive site.

Added a simple guard to fix this.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2018-10-31 11:17:26 +01:00 committed by Dirk Hohndel
parent dec9401f48
commit 68d7e7c4e3

View file

@ -604,7 +604,7 @@ void MainTab::updateDiveInfo(bool clear)
else
ui.cylinders->view()->hideColumn(CylindersModel::USE);
if (verbose)
if (verbose && displayed_dive.dive_site)
qDebug() << "Set the current dive site:" << displayed_dive.dive_site->uuid;
emit diveSiteChanged();
}