mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:53:23 +00:00
Don't use dive before checking it against NULL
Dive gets dereferenced in get_surface_pressure_in_mbar(). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
989c8f0110
commit
9ee0bfe633
1 changed files with 2 additions and 1 deletions
|
@ -388,10 +388,11 @@ double init_decompression(struct dive *dive)
|
|||
timestamp_t when, lasttime = 0;
|
||||
bool deco_init = false;
|
||||
double tissue_tolerance, surface_pressure;
|
||||
tissue_tolerance = surface_pressure = get_surface_pressure_in_mbar(dive, true) / 1000.0;
|
||||
|
||||
if (!dive)
|
||||
return 0.0;
|
||||
|
||||
tissue_tolerance = surface_pressure = get_surface_pressure_in_mbar(dive, true) / 1000.0;
|
||||
divenr = get_divenr(dive);
|
||||
when = dive->when;
|
||||
i = divenr;
|
||||
|
|
Loading…
Add table
Reference in a new issue