From: dbv Date: Wed, 22 Aug 2018 09:52:18 +0000 (+0300) Subject: Issue #2597: Fatal error when smash X-Git-Tag: SHAPER_V9_1_0RC1~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5180ef5c2d50e3adc1934716ebcd8b8e9961a0da;p=modules%2Fshaper.git Issue #2597: Fatal error when smash Updated validator for Smash arguments: features not allowed for selection. --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index f68b80173..9dfd94eaa 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -1214,6 +1214,12 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid( for (int anIndex = 0; anIndex < anOtherAttrSelectionList->size(); ++anIndex) { AttributeSelectionPtr anAttrSelection = anOtherAttrSelectionList->value(anIndex); + + if (anAttrSelection->contextFeature().get()) { + theError = "Error: Features not allowed for selection."; + return false; + } + ResultPtr aContext = anAttrSelection->context(); std::shared_ptr aShape = anAttrSelection->value(); GeomShapePtr aContextShape = aContext->shape(); @@ -1242,6 +1248,12 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid( theError = "Error: Empty attribute selection."; return false; } + + if (anAttrSelection->contextFeature().get()) { + theError = "Error: Features not allowed for selection."; + return false; + } + ResultPtr aContext = anAttrSelection->context(); if(!aContext.get()) { FeaturePtr aContFeat = anAttrSelection->contextFeature();