From c7e9ff1b628f55963a6a13aaff9f4f0225a5c4cf Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 5 May 2018 22:44:29 +0200 Subject: [PATCH] set exception message when returning with 0 --- src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp b/src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp index 5a1a0f4929..eaec6d454a 100644 --- a/src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp +++ b/src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp @@ -86,7 +86,10 @@ PyObject* PathSimPy::GetResultMesh(PyObject * args) return 0; cStock *stock = getPathSimPtr()->m_stock; if (stock == NULL) + { + PyErr_SetString(PyExc_RuntimeError, "Simulation has stock object"); return 0; + } Mesh::MeshObject *meshOuter = new Mesh::MeshObject(); Mesh::MeshPy *meshOuterpy = new Mesh::MeshPy(meshOuter);