aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-11 07:29:29 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-11 07:29:29 -0800
commitbccbdf8264cd86890f0719e10e665a73b062e96e (patch)
tree88be8912c13ddf70de0ae694ccaef447703b4352 /qt-ui/maintab.cpp
parente219bc70f863eaaa9b81ba5abc240975a128c904 (diff)
downloadsubsurface-bccbdf8264cd86890f0719e10e665a73b062e96e.tar.gz
Don't use current_dc unless you know there's a current_dive
This will crash if for some reason current_dive is invalid. And in general, when displaying information, we want to use the correct dc in the displayed_dive, not the current_dc, which references the current_dive... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index d930cbff9..89208b5c7 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -514,7 +514,7 @@ void MainTab::updateDiveInfo(bool clear)
ui.otuText->setText(QString("%1").arg(displayed_dive.otu));
ui.waterTemperatureText->setText(get_temperature_string(displayed_dive.watertemp, true));
ui.airTemperatureText->setText(get_temperature_string(displayed_dive.airtemp, true));
- ui.DiveType->setCurrentIndex(current_dc->divemode);
+ ui.DiveType->setCurrentIndex(get_dive_dc(&displayed_dive, dc_number)->divemode);
volume_t gases[MAX_CYLINDERS] = {};
get_gas_used(&displayed_dive, gases);
QString volumes;