summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-models/diveplannermodel.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index d2fe5e84a..537bf278f 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -1014,8 +1014,10 @@ void DivePlannerPointsModel::computeVariationsFreeDeco(struct diveplan *original
void DivePlannerPointsModel::computeVariations(struct diveplan *original_plan, const struct deco_state *previous_ds)
{
+ // nothing to do unless there's an original plan
+ if (!original_plan)
+ return;
-// bool oldRecalc = setRecalc(false);
struct dive *dive = alloc_dive();
copy_dive(&displayed_dive, dive);
struct decostop original[60], deeper[60], shallower[60], shorter[60], longer[60];
@@ -1024,10 +1026,6 @@ void DivePlannerPointsModel::computeVariations(struct diveplan *original_plan, c
struct divedatapoint *last_segment;
struct deco_state ds = *previous_ds;
- if (!original_plan)
- return;
-
-
if (in_planner() && prefs.display_variations && decoMode() != RECREATIONAL) {
int my_instance = ++instanceCounter;
cache_deco_state(&ds, &save);