Core: Make sure that PropertyMaterialList cannot become empty
The PropertyMaterialList is supposed to guarantee that it always has at least one element
This commit is contained in:
@@ -2651,6 +2651,18 @@ PropertyMaterialList::~PropertyMaterialList() = default;
|
||||
//**************************************************************************
|
||||
// Base class implementer
|
||||
|
||||
void PropertyMaterialList::setValues(const std::vector<App::Material>& newValues)
|
||||
{
|
||||
if (!newValues.empty()) {
|
||||
PropertyListsT<Material>::setValues(newValues);
|
||||
}
|
||||
else {
|
||||
aboutToSetValue();
|
||||
setSize(1);
|
||||
hasSetValue();
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* PropertyMaterialList::getPyObject()
|
||||
{
|
||||
Py::Tuple tuple(getSize());
|
||||
|
||||
Reference in New Issue
Block a user