Fix: error in previous commit

This commit is contained in:
Jacques Lucke 2022-04-09 11:24:30 +02:00
parent a45976957e
commit a3827d4b29
1 changed files with 1 additions and 1 deletions

View File

@ -217,7 +217,7 @@ static MutableSpan<T> get_mutable_attribute(CurvesGeometry &curves,
data = (T *)CustomData_add_layer_named(
&custom_data, type, CD_CALLOC, nullptr, size, name.c_str());
MutableSpan<T> span = {data, size};
if (span.first() != default_value) {
if (size > 0 && span.first() != default_value) {
span.fill(default_value);
}
return span;