Part: Crash when calling SubShapes of empty shape from Python

This commit is contained in:
marioalexis
2021-01-10 23:05:14 -03:00
committed by abdullahtahiriyo
parent e4535762db
commit b263c2aa87

View File

@@ -2972,8 +2972,13 @@ void TopoShapePy::setOrientation(Py::String arg)
Py::List TopoShapePy::getSubShapes(void) const
{
Py::List ret;
for(TopoDS_Iterator it(getTopoShapePtr()->getShape());it.More();it.Next())
ret.append(shape2pyshape(it.Value()));
const TopoDS_Shape& shape = getTopoShapePtr()->getShape();
if (!shape.IsNull()) {
for(TopoDS_Iterator it(shape);it.More();it.Next())
ret.append(shape2pyshape(it.Value()));
}
return ret;
}