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 72d5adf4a8
commit 2d4049ef52
5 changed files with 33 additions and 0 deletions

View File

@@ -1627,6 +1627,11 @@ PyObject* Application::sCoinRemoveAllChildren(PyObject * /*self*/, PyObject *arg
PY_TRY {
void* ptr = nullptr;
Base::Interpreter().convertSWIGPointerObj("pivy.coin","_p_SoGroup", pynode, &ptr, 0);
if (!ptr) {
PyErr_SetString(PyExc_RuntimeError, "Conversion of coin.SoGroup failed");
return nullptr;
}
coinRemoveAllChildren(static_cast<SoGroup*>(ptr));
Py_Return;
}