App: handle exception on change Link CopyOnChange
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#include <boost/property_map/property_map.hpp>
|
||||
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
@@ -460,11 +461,17 @@ void LinkBaseExtension::setOnChangeCopyObject(
|
||||
if (external == exclude && !prop)
|
||||
return;
|
||||
|
||||
prop = static_cast<PropertyMap*>(
|
||||
obj->addDynamicProperty("App::PropertyMap", "_CopyOnChangeControl"));
|
||||
if (!prop) {
|
||||
FC_ERR("Failed to setup copy on change object " << obj->getFullName());
|
||||
return;
|
||||
try {
|
||||
prop = static_cast<PropertyMap*>(
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user