diff --git a/src/App/Link.cpp b/src/App/Link.cpp index 1532a49014..7c8ad8d91e 100644 --- a/src/App/Link.cpp +++ b/src/App/Link.cpp @@ -21,6 +21,7 @@ ****************************************************************************/ #include "PreCompiled.h" +#include #include #include @@ -460,11 +461,17 @@ void LinkBaseExtension::setOnChangeCopyObject( if (external == exclude && !prop) return; - prop = static_cast( - obj->addDynamicProperty("App::PropertyMap", "_CopyOnChangeControl")); if (!prop) { - FC_ERR("Failed to setup copy on change object " << obj->getFullName()); - return; + try { + prop = static_cast( + obj->addDynamicProperty("App::PropertyMap", "_CopyOnChangeControl")); + } catch (Base::Exception &e) { + e.ReportException(); + } + if (!prop) { + FC_ERR("Failed to setup copy on change object " << obj->getFullName()); + return; + } } const char *key = flags.testFlag(OnChangeCopyOptions::ApplyAll) ? "*" : parent->getNameInDocument();