From 632eaeadebbfccfc366b1435ff5761c4a3eaadd0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 25 Dec 2015 09:47:25 +0100 Subject: [PATCH] + fixes #0002372: Application terminates on attempt to change external geometry from a sketch + fixes #0002373: When Measuring in the distance between two external geometry Freecad crashes --- src/Mod/Sketcher/App/planegcs/GCS.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index cb12453ed..7f282bbfc 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -3369,6 +3369,15 @@ int System::diagnose(Algorithm alg) return dofs; } + // When adding an external geometry or a constraint on an external geometry the array 'plist' is empty. + // So, we must abort here because otherwise we would create an invalid matrix and make the application + // eventually crash. This fixes issues #0002372/#0002373. + if (plist.empty()) { + hasDiagnosis = true; + dofs = plist.size(); + return dofs; + } + redundant.clear(); conflictingTags.clear(); redundantTags.clear();