[PATCH] Don't crash if we try to save a empty plan

Anton Lundin glance at acc.umu.se
Sat Mar 22 07:13:59 PDT 2014


Just treat it as a cancel instead.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 qt-ui/diveplanner.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index da5bb53..ac2662c 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);
-- 
1.8.3.2



More information about the subsurface mailing list