diff --git a/src/App/DocumentObserverPython.cpp b/src/App/DocumentObserverPython.cpp index 0bfe02807315..417bab899267 100644 --- a/src/App/DocumentObserverPython.cpp +++ b/src/App/DocumentObserverPython.cpp @@ -239,9 +239,13 @@ void DocumentObserverPython::slotChangedObject(const App::DocumentObject& Obj, Py::Callable method(this->inst.getAttr(std::string("slotChangedObject"))); Py::Tuple args(2); args.setItem(0, Py::Object(const_cast(Obj).getPyObject(), true)); - std::string prop_name = Obj.getPropertyName(&Prop); - args.setItem(1, Py::String(prop_name)); - method.apply(args); + // If a property is touched but not part of a document object then its name is null. + // In this case the slot function must not be called. + const char* prop_name = Obj.getPropertyName(&Prop); + if (prop_name) { + args.setItem(1, Py::String(prop_name)); + method.apply(args); + } } } catch (Py::Exception&) {