From 65889b6c80bed790eb6e68063bebaaeaa3edcfc3 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Mon, 16 May 2022 08:56:52 +0800 Subject: [PATCH] App: Fix Origin::extensionGetSubObject() --- src/App/Origin.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App/Origin.cpp b/src/App/Origin.cpp index 4db67ca653..2d98938eb1 100644 --- a/src/App/Origin.cpp +++ b/src/App/Origin.cpp @@ -219,7 +219,12 @@ bool Origin::OriginExtension::extensionGetSubObject(DocumentObject *&ret, const ret = obj->getOriginFeature(name.c_str()); if (!ret) return false; - ret = ret->getSubObject(subname + name.size() + 1, pyobj, mat, true, depth+1); + const char *dot = strchr(subname, '.'); + if (dot) + subname = dot+1; + else + subname = ""; + ret = ret->getSubObject(subname, pyobj, mat, true, depth+1); return true; } catch (const Base::Exception& e) {