From fc1336107930b01d5280777037f1b30d4be09fee Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Sat, 22 Mar 2014 15:13:59 +0100 Subject: Don't crash if we try to save a empty plan Just treat it as a cancel instead. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'qt-ui/diveplanner.cpp') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index da5bb53d6..ac2662c2b 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1468,6 +1468,9 @@ void DivePlannerPointsModel::createPlan() char *cache = NULL; tempDive = NULL; + if (!diveplan.dp) + return cancelPlan(); + createTemporaryPlan(); plan(&diveplan, &cache, &tempDive, isPlanner()); copy_cylinders(stagingDive, tempDive); -- cgit v1.2.3-70-g09d2