App: Bugfix for NULL-Pointer dereference of Property->getName()

This commit is contained in:
wmayer
2022-01-16 14:30:51 +01:00
parent 8525033bcc
commit b35623e680
14 changed files with 40 additions and 16 deletions

View File

@@ -165,7 +165,9 @@ ObjectIdentifier::ObjectIdentifier(const Property &prop, int index)
DocumentObject * docObj = freecad_dynamic_cast<DocumentObject>(prop.getContainer());
if (!docObj)
FC_THROWM(Base::TypeError,"Property must be owned by a document object.");
FC_THROWM(Base::TypeError, "Property must be owned by a document object.");
if (!prop.hasName())
FC_THROWM(Base::RuntimeError, "Property must have a name.");
owner = const_cast<DocumentObject*>(docObj);