From 7cdc278cf3f87406e7b89730fc4d58350251aad5 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 29 Jan 2018 22:20:15 +0100 Subject: [PATCH] fix crash in fillet/chamfer dialog if no part exists in document --- src/Mod/Part/Gui/DlgFilletEdges.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Mod/Part/Gui/DlgFilletEdges.cpp b/src/Mod/Part/Gui/DlgFilletEdges.cpp index c1a04411d2..5513470ae8 100644 --- a/src/Mod/Part/Gui/DlgFilletEdges.cpp +++ b/src/Mod/Part/Gui/DlgFilletEdges.cpp @@ -793,10 +793,12 @@ void DlgFilletEdges::on_selectAllButton_clicked() model->blockSignals(block); model->updateCheckStates(); - App::Document* doc = d->object->getDocument(); - Gui::Selection().addSelection(doc->getName(), - d->object->getNameInDocument(), - subElements); + if (d->object) { + App::Document* doc = d->object->getDocument(); + Gui::Selection().addSelection(doc->getName(), + d->object->getNameInDocument(), + subElements); + } } void DlgFilletEdges::on_selectNoneButton_clicked() @@ -811,8 +813,10 @@ void DlgFilletEdges::on_selectNoneButton_clicked() model->blockSignals(block); model->updateCheckStates(); - App::Document* doc = d->object->getDocument(); - Gui::Selection().clearSelection(doc->getName()); + if (d->object) { + App::Document* doc = d->object->getDocument(); + Gui::Selection().clearSelection(doc->getName()); + } } void DlgFilletEdges::on_filletType_activated(int index)