+ check for null shape before calling BRep_Tool::IsClosed

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5379 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer
2012-01-02 14:03:55 +00:00
parent ef11dd0abf
commit 7d7eefc7ca
2 changed files with 5 additions and 1 deletions

View File

@@ -1030,6 +1030,8 @@ PyObject* TopoShapePy::isClosed(PyObject *args)
if (!PyArg_ParseTuple(args, ""))
return NULL;
try {
if (getTopoShapePtr()->_Shape.IsNull())
Standard_Failure::Raise("Cannot determine the 'Closed'' flag of an empty shape");
return Py_BuildValue("O", (getTopoShapePtr()->isClosed() ? Py_True : Py_False));
}
catch (...) {