[Bf-blender-cvs] [a23c7fd570d] master: Geometry Nodes: forbid creating attribute with empty name
Jacques Lucke
noreply at git.blender.org
Fri Feb 19 18:10:31 CET 2021
Commit: a23c7fd570d200bd95b0012fd6afd341f7d88d8d
Author: Jacques Lucke
Date: Fri Feb 19 18:08:40 2021 +0100
Branches: master
https://developer.blender.org/rBa23c7fd570d200bd95b0012fd6afd341f7d88d8d
Geometry Nodes: forbid creating attribute with empty name
Empty attribute names are just a recipe for problems.
===================================================================
M source/blender/blenkernel/intern/attribute_access.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc
index dcf5f6434cf..f394a4acb0c 100644
--- a/source/blender/blenkernel/intern/attribute_access.cc
+++ b/source/blender/blenkernel/intern/attribute_access.cc
@@ -1641,9 +1641,12 @@ bool GeometryComponent::attribute_try_create(const StringRef attribute_name,
const CustomDataType data_type)
{
using namespace blender::bke;
+ if (attribute_name.is_empty()) {
+ return false;
+ }
const ComponentAttributeProviders *providers = this->get_attribute_providers();
if (providers == nullptr) {
- return {};
+ return false;
}
const BuiltinAttributeProvider *builtin_provider =
providers->builtin_attribute_providers().lookup_default_as(attribute_name, nullptr);
More information about the Bf-blender-cvs
mailing list