RNA: Fail makesrna if enum identifiers contain spaces
We could of course always add checks for more invalid characters, but I'd say they are more unlikely to happen.
This commit is contained in:
@@ -1832,8 +1832,18 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
|
||||
for (i = 0; item[i].identifier; i++) {
|
||||
eprop->totitem++;
|
||||
|
||||
if (item[i].identifier[0] && item[i].value == eprop->defaultvalue) {
|
||||
defaultfound = 1;
|
||||
if (item[i].identifier[0]) {
|
||||
if (strstr(item[i].identifier, " ")) {
|
||||
CLOG_ERROR(&LOG,
|
||||
"\"%s.%s\", enum identifiers must not contain spaces.",
|
||||
srna->identifier,
|
||||
prop->identifier);
|
||||
DefRNA.error = 1;
|
||||
break;
|
||||
}
|
||||
else if (item[i].value == eprop->defaultvalue) {
|
||||
defaultfound = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user