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

@@ -2263,6 +2263,9 @@ private:
try {
TopoShape* shape = new TopoShape();
Base::Interpreter().convertSWIGPointerObj("OCC.TopoDS","TopoDS_Shape *", proxy, &ptr, 0);
if (!ptr) {
throw Py::RuntimeError("Conversion of OCC.TopoDS.TopoDS_Shape failed");
}
TopoDS_Shape* s = static_cast<TopoDS_Shape*>(ptr);
shape->setShape(*s);
return Py::asObject(new TopoShapePy(shape));