set exception message when returning with 0

This commit is contained in:
wmayer
2018-05-05 22:44:29 +02:00
parent 9111efacb2
commit c7e9ff1b62

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