mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't dereference NULL pointer when adding tanks to a dive plan
The code was obviously bogus before. Fixes #429 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d760493299
commit
f11001ff4e
1 changed files with 5 additions and 3 deletions
|
@ -1429,11 +1429,13 @@ void DivePlannerPointsModel::createTemporaryPlan()
|
||||||
cylinder_t *cyl = &stagingDive->cylinder[i];
|
cylinder_t *cyl = &stagingDive->cylinder[i];
|
||||||
if (cyl->depth.mm) {
|
if (cyl->depth.mm) {
|
||||||
dp = create_dp(0, cyl->depth.mm, cyl->gasmix.o2.permille, cyl->gasmix.he.permille, 0);
|
dp = create_dp(0, cyl->depth.mm, cyl->gasmix.o2.permille, cyl->gasmix.he.permille, 0);
|
||||||
if (diveplan.dp)
|
if (diveplan.dp) {
|
||||||
dp->next = diveplan.dp->next;
|
dp->next = diveplan.dp->next;
|
||||||
else
|
diveplan.dp->next = dp;
|
||||||
|
} else {
|
||||||
dp->next = NULL;
|
dp->next = NULL;
|
||||||
diveplan.dp->next = dp;
|
diveplan.dp = dp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if DEBUG_PLAN
|
#if DEBUG_PLAN
|
||||||
|
|
Loading…
Add table
Reference in a new issue