mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
Fix potential crash
Commits0de3bc8452
("Display CCR setpoint values on the po2 graph") and65eed80e37
("Don't always show the setpoint graph") didn't take into account that current_dive could be NULL and therefore accessing current_dc could crash. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f42b986474
commit
925bb019c7
1 changed files with 2 additions and 2 deletions
|
@ -531,7 +531,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
|
|||
currentdc = fake_dc(currentdc);
|
||||
}
|
||||
|
||||
if ((current_dc->dctype == CCR) && (prefs.show_ccr_setpoint))
|
||||
if (current_dive && (currentdc->dctype == CCR) && (prefs.show_ccr_setpoint))
|
||||
o2SetpointGasItem->setVisible(true);
|
||||
else
|
||||
o2SetpointGasItem->setVisible(false);
|
||||
|
@ -991,7 +991,7 @@ void ProfileWidget2::setProfileState()
|
|||
}
|
||||
pn2GasItem->setVisible(prefs.pp_graphs.pn2);
|
||||
po2GasItem->setVisible(prefs.pp_graphs.po2);
|
||||
o2SetpointGasItem->setVisible((current_dc->dctype == CCR) && (prefs.show_ccr_setpoint));
|
||||
o2SetpointGasItem->setVisible(current_dive && (current_dc->dctype == CCR) && (prefs.show_ccr_setpoint));
|
||||
pheGasItem->setVisible(prefs.pp_graphs.phe);
|
||||
|
||||
timeAxis->setPos(itemPos.time.pos.on);
|
||||
|
|
Loading…
Add table
Reference in a new issue