From 68d7e7c4e386f8dfe2068cf8075aeef8f3dff367 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Wed, 31 Oct 2018 11:17:26 +0100 Subject: 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 --- desktop-widgets/tab-widgets/maintab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 1c0914e7f..102570174 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -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(); } -- cgit v1.2.3-70-g09d2