diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index 772c54986c..a89b5343cb 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -703,10 +703,10 @@ void PropertyLinkSubList::setValue(DocumentObject* lValue,const char* SubName) } void PropertyLinkSubList::setValues(const std::vector& lValue,const std::vector& lSubNames) -{ +{ if (lValue.size() != lSubNames.size()) throw Base::ValueError("PropertyLinkSubList::setValues: size of subelements list != size of objects list"); - + #ifndef USE_OLD_DAG //maintain backlinks. if (getContainer() && getContainer()->isDerivedFrom(App::DocumentObject::getClassTypeId())) { @@ -731,8 +731,10 @@ void PropertyLinkSubList::setValues(const std::vector& lValue,c _lValueList = lValue; _lSubList.resize(lSubNames.size()); int i = 0; - for (std::vector::const_iterator it = lSubNames.begin();it!=lSubNames.end();++it) - _lSubList[i] = *it; + for (std::vector::const_iterator it = lSubNames.begin();it!=lSubNames.end();++it,++i) { + if (*it != nullptr) + _lSubList[i] = *it; + } hasSetValue(); }