mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-24 01:22:05 +05:00
PAL14122: EDF 307: GEOM: GetInPlace --> COMM_FAILURE. Prevent crash.
This commit is contained in:
parent
4af09427cd
commit
3b3e7ac44c
@ -2268,6 +2268,10 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace
|
|||||||
TColStd_ListOfInteger aModifiedList;
|
TColStd_ListOfInteger aModifiedList;
|
||||||
isFound = GetInPlaceOfCompound(aWhereFunction, aWhat, aModifiedList);
|
isFound = GetInPlaceOfCompound(aWhereFunction, aWhat, aModifiedList);
|
||||||
if (isFound) {
|
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());
|
aModifiedArray = new TColStd_HArray1OfInteger (1, aModifiedList.Extent());
|
||||||
TColStd_ListIteratorOfListOfInteger anIterModif (aModifiedList);
|
TColStd_ListIteratorOfListOfInteger anIterModif (aModifiedList);
|
||||||
for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
|
for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
|
||||||
@ -2284,6 +2288,10 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace
|
|||||||
|
|
||||||
//Add a new object
|
//Add a new object
|
||||||
Handle(GEOM_Object) aResult = GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
|
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) {
|
if (aModifiedArray->Length() > 1) {
|
||||||
//Set a GROUP type
|
//Set a GROUP type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user