set exception message when returning with 0

This commit is contained in:
wmayer
2018-05-05 22:44:29 +02:00
parent 8d4f31f021
commit cb4a5ee180

View File

@@ -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);