const bool theAnotherDoc)
{
std::string aName("Undefined name");
- if(!theContext.get() || theContext->shape()->isNull())
+ if(!theContext.get()
+ || !theContext->shape().get()
+ || theContext->shape()->isNull()) {
return !theDefaultName.empty() ? theDefaultName : aName;
+ }
// if it is in result of another part
std::shared_ptr<Model_Document> aDoc =
ResultConstructionPtr aResult =
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(lastResult());
- if (aResult && aResult->shape()) {
+ if (aResult && aResult->shape() && theID == EXTERNAL_FEATURE_ID()) {
aResult->setShape(std::shared_ptr<GeomAPI_Edge>());
aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape());
}