diff options
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 6fb9ecef3..223d9d657 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1422,8 +1422,6 @@ void DivePlannerPointsModel::createTemporaryPlan() lastIndex = i; plan_add_segment(&diveplan, deltaT, p.depth, p.o2, p.he, p.po2); } - if (!diveplan.dp) - return; char *cache = NULL; tempDive = NULL; const char *errorString = NULL; @@ -1432,7 +1430,10 @@ void DivePlannerPointsModel::createTemporaryPlan() cylinder_t *cyl = &stagingDive->cylinder[i]; if (cyl->depth.mm) { dp = create_dp(0, cyl->depth.mm, cyl->gasmix.o2.permille, cyl->gasmix.he.permille, 0); - dp->next = diveplan.dp->next; + if (diveplan.dp) + dp->next = diveplan.dp->next; + else + dp->next = NULL; diveplan.dp->next = dp; } } |