From d9fd4cb69bbc3420cc78639778496b4746a61f5b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 24 Jan 2015 14:42:25 -0800 Subject: Fix crash with empty dive list Don't access current_dc unless there is a valid current_dive. Fixes #817 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index ea2a42d49..2263cbf97 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -981,7 +981,7 @@ void ProfileWidget2::setProfileState() po2GasItem->setVisible(prefs.pp_graphs.po2); pheGasItem->setVisible(prefs.pp_graphs.phe); - bool setpointflag = (current_dc->divemode == CCR) && prefs.pp_graphs.po2 && current_dive; + bool setpointflag = current_dive && (current_dc->divemode == CCR) && prefs.pp_graphs.po2; bool sensorflag = setpointflag && prefs.show_ccr_sensors; o2SetpointGasItem->setVisible(setpointflag && prefs.show_ccr_setpoint); ccrsensor1GasItem->setVisible(sensorflag); -- cgit v1.2.3-70-g09d2