App: fix crash on accessing non-existent attribute in ObjectIdentifier
This commit is contained in:
@@ -600,6 +600,8 @@ size_t ObjectIdentifier::Component::getIndex(size_t count) const {
|
||||
Py::Object ObjectIdentifier::Component::get(const Py::Object &pyobj) const {
|
||||
Py::Object res;
|
||||
if(isSimple()) {
|
||||
if(!pyobj.hasAttr(getName()))
|
||||
FC_THROWM(Base::AttributeError, "No attribute named '" << getName() << "'");
|
||||
res = pyobj.getAttr(getName());
|
||||
} else if(isArray()) {
|
||||
if(pyobj.isMapping())
|
||||
|
||||
Reference in New Issue
Block a user