diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-01-24 14:42:25 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-24 14:42:25 -0800 |
commit | d9fd4cb69bbc3420cc78639778496b4746a61f5b (patch) | |
tree | 1a300960b5b5fef48bf6bc7210815b577ba07464 /qt-ui | |
parent | b8b15165f0db73b1edf1b0a56b31166a9f669df4 (diff) | |
download | subsurface-d9fd4cb69bbc3420cc78639778496b4746a61f5b.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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); |