Core: Check returned pointer of convertSWIGPointerObj
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user