]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix crash on selection of result of empty part.
authorazv <azv@opencascade.com>
Thu, 5 Sep 2019 07:37:30 +0000 (10:37 +0300)
committerazv <azv@opencascade.com>
Thu, 5 Sep 2019 07:37:30 +0000 (10:37 +0300)
src/ModuleBase/ModuleBase_WidgetSelector.cpp

index b0c30bb74f4df4383f9cfa9376108179d44f3f82..7d701aaf55616c5e93f9c54a17a02be658caf427 100644 (file)
@@ -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<TopoDS_Shape>();
-    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);
+      }
     }
   }