From: azv Date: Thu, 5 Sep 2019 07:37:30 +0000 (+0300) Subject: Fix crash on selection of result of empty part. X-Git-Tag: VEDF2019Lot4~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a5e8dd0b6eae6660f0d10e659b2b604a4bbed65b;p=modules%2Fshaper.git Fix crash on selection of result of empty part. --- 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); + } } }