fixes #0002926: Trying to access Part.Shape.children() before doc.recompute() crashes the whole program

This commit is contained in:
wmayer
2017-06-03 13:46:05 +02:00
parent 98f8879e24
commit 88bd341ad2

View File

@@ -1163,7 +1163,12 @@ PyObject* TopoShapePy::childShapes(PyObject *args)
return NULL;
try {
TopoDS_Iterator it(getTopoShapePtr()->getShape(),
const TopoDS_Shape& shape = getTopoShapePtr()->getShape();
if (shape.IsNull()) {
PyErr_SetString(PyExc_ValueError, "Shape is null");
return NULL;
}
TopoDS_Iterator it(shape,
PyObject_IsTrue(cumOri) ? Standard_True : Standard_False,
PyObject_IsTrue(cumLoc) ? Standard_True : Standard_False);
Py::List list;