Fix: CustomData crash in debug builds with empty name
Due to a recent change the name of a layer is passed using a string ref
but the check if it is filled was done by checking if the first char
was zero. This fails as string ref first does the bound checks.
This is fixed by using `!is_empty()`. There might be more places, but this
one fired when loading production files.
Issue introduced by a39e8a4ab9
Pull Request: https://projects.blender.org/blender/blender/pulls/118605
This commit is contained in:
parent
77cba3d551
commit
17842d4d40
|
@ -4593,7 +4593,7 @@ void CustomData_validate_layer_name(const CustomData *data,
|
|||
int index = -1;
|
||||
|
||||
/* if a layer name was given, try to find that layer */
|
||||
if (name[0]) {
|
||||
if (!name.is_empty()) {
|
||||
index = CustomData_get_named_layer_index(data, type, name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue