From 7cfc084e476fcf6c189a9d41596d68fd265d71d9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 16 Jul 2017 16:56:06 +0200 Subject: [PATCH] fixes #0003122: FC 0.17 crashes when a sketched located outside a body object --- src/Mod/PartDesign/Gui/Command.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index d89bef17e9..8541f23ab2 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -859,7 +859,10 @@ void prepareProfileBased(Gui::Command* cmd, const std::string& which, auto* pcActiveBody = PartDesignGui::getBody(false); if (pcActiveBody && !bNoSketchWasSelected && ext) { - auto* pcActivePart = PartDesignGui::getPartFor(pcActiveBody, false); + auto* pcActivePart = PartDesignGui::getPartFor(pcActiveBody, true); + // getPartFor() already has reported an error + if (!pcActivePart) + return; QDialog* dia = new QDialog; Ui_Dialog dlg;