TColStd_ListOfInteger aModifiedList;
isFound = GetInPlaceOfCompound(aWhereFunction, aWhat, aModifiedList);
if (isFound) {
+ if (aModifiedList.Extent() < 1) {
+ SetErrorCode("Error: Empty modifications history for all sub-shapes of the sought shape.");
+ return NULL;
+ }
aModifiedArray = new TColStd_HArray1OfInteger (1, aModifiedList.Extent());
TColStd_ListIteratorOfListOfInteger anIterModif (aModifiedList);
for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
//Add a new object
Handle(GEOM_Object) aResult = GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
+ if (aResult.IsNull()) {
+ SetErrorCode("Error in algorithm: result found, but cannot be returned.");
+ return NULL;
+ }
if (aModifiedArray->Length() > 1) {
//Set a GROUP type