Fix RNA not giving error with invalid identifiers for collection properties

This commit is contained in:
Brecht Van Lommel 2020-11-19 16:26:48 +01:00
parent a44bb8603e
commit 0d027b4583
1 changed files with 7 additions and 0 deletions

View File

@ -3458,6 +3458,13 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop,
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
{
char error[512];
if (rna_validate_identifier(type, error, false) == 0) {
CLOG_ERROR(&LOG, "struct identifier \"%s\" error - %s", type, error);
DefRNA.error = true;
return;
}
prop->srna = (StructRNA *)type;
}