Core: Check returned pointer of convertSWIGPointerObj

This commit is contained in:
wmayer
2024-10-08 22:31:46 +02:00
committed by Chris Hennes
parent baee132f76
commit 9bfa461520
5 changed files with 33 additions and 0 deletions

View File

@@ -319,6 +319,10 @@ PyObject* ViewProviderPy::addDisplayMode(PyObject * args)
void* ptr = nullptr;
try {
Base::Interpreter().convertSWIGPointerObj("pivy.coin","_p_SoNode", obj, &ptr, 0);
if (!ptr) {
PyErr_SetString(PyExc_RuntimeError, "Conversion of coin.SoNode failed");
return nullptr;
}
}
catch (const Base::Exception& e) {
PyErr_SetString(PyExc_RuntimeError, e.what());