From 9a393e2b709864fea89612c4428778124894e72d Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Fri, 6 May 2022 14:00:53 +0800 Subject: [PATCH] App: fix Origin getSubObject() --- src/App/Origin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App/Origin.cpp b/src/App/Origin.cpp index 9285fcff8b..4db67ca653 100644 --- a/src/App/Origin.cpp +++ b/src/App/Origin.cpp @@ -197,7 +197,7 @@ void Origin::OriginExtension::initExtension(ExtensionContainer* obj) { } bool Origin::OriginExtension::extensionGetSubObject(DocumentObject *&ret, const char *subname, - PyObject **, Base::Matrix4D *, bool, int) const { + PyObject **pyobj, Base::Matrix4D *mat, bool, int depth) const { if (!subname || subname[0] == '\0') { return false; } @@ -217,6 +217,9 @@ bool Origin::OriginExtension::extensionGetSubObject(DocumentObject *&ret, const try { ret = obj->getOriginFeature(name.c_str()); + if (!ret) + return false; + ret = ret->getSubObject(subname + name.size() + 1, pyobj, mat, true, depth+1); return true; } catch (const Base::Exception& e) {