From 4236eba0cb691aab17147d96f5ac5fa1a73d619f Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 15 Aug 2016 17:00:41 +0300 Subject: [PATCH] Issue #1648: Dump Python in the High Level Parameterized Geometry API. Shape of selection may be empty (if the whole context is selected). --- src/ModelHighAPI/ModelHighAPI_Selection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.cpp b/src/ModelHighAPI/ModelHighAPI_Selection.cpp index 0c4e764f5..e45f008c0 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Selection.cpp @@ -82,8 +82,10 @@ TypeSubShapeNamePair ModelHighAPI_Selection::typeSubShapeNamePair() const std::string ModelHighAPI_Selection::shapeType() const { switch(myVariantType) { - case VT_ResultSubShapePair: return myResultSubShapePair.second->shapeTypeStr(); - case VT_TypeSubShapeNamePair: return myTypeSubShapeNamePair.first; + case VT_ResultSubShapePair: + return myResultSubShapePair.second.get() ? myResultSubShapePair.second->shapeTypeStr() : + myResultSubShapePair.first->shape()->shapeTypeStr(); + case VT_TypeSubShapeNamePair: return myTypeSubShapeNamePair.first; } return "SHAPE"; -- 2.39.2