diff --git a/src/Mod/Part/App/AppPartPy.cpp b/src/Mod/Part/App/AppPartPy.cpp index 69948f597..763f6da53 100644 --- a/src/Mod/Part/App/AppPartPy.cpp +++ b/src/Mod/Part/App/AppPartPy.cpp @@ -358,15 +358,23 @@ static PyObject * makeFilledFace(PyObject *self, PyObject *args) try { Py::List list(obj); + int countEdges = 0; for (Py::List::iterator it = list.begin(); it != list.end(); ++it) { if (PyObject_TypeCheck((*it).ptr(), &(Part::TopoShapeEdgePy::Type))) { const TopoDS_Shape& sh = static_cast((*it).ptr())-> getTopoShapePtr()->_Shape; - if (!sh.IsNull()) + if (!sh.IsNull()) { builder.Add(TopoDS::Edge(sh), GeomAbs_C0); + countEdges++; + } } } + if (countEdges == 0) { + PyErr_SetString(PyExc_Exception, "Failed to created face with no edges"); + return 0; + } + builder.Build(); if (builder.IsDone()) { return new TopoShapeFacePy(new TopoShape(builder.Face()));