From a5e8dd0b6eae6660f0d10e659b2b604a4bbed65b Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 5 Sep 2019 10:37:30 +0300 Subject: [PATCH] Fix crash on selection of result of empty part. --- src/ModuleBase/ModuleBase_WidgetSelector.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.cpp b/src/ModuleBase/ModuleBase_WidgetSelector.cpp index b0c30bb74..7d701aaf5 100644 --- a/src/ModuleBase/ModuleBase_WidgetSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelector.cpp @@ -149,11 +149,13 @@ bool ModuleBase_WidgetSelector::acceptSubShape(const GeomShapePtr& theShape, if (aShape.get()) { // Check that the selection corresponds to selection type TopoDS_Shape aTopoShape = aShape->impl(); - aShapeType = aTopoShape.ShapeType(); - // for compounds check sub-shapes: it may be compound of needed type: - // Booleans may produce compounds of Solids - if (aShapeType == TopAbs_COMPOUND) { - aShapeType = ModuleBase_Tools::getCompoundSubType(aTopoShape); + if (!aTopoShape.IsNull()) { + aShapeType = aTopoShape.ShapeType(); + // for compounds check sub-shapes: it may be compound of needed type: + // Booleans may produce compounds of Solids + if (aShapeType == TopAbs_COMPOUND) { + aShapeType = ModuleBase_Tools::getCompoundSubType(aTopoShape); + } } } -- 2.39.2