mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
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>
This commit is contained in:
parent
e219bc70f8
commit
bccbdf8264
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue