[Bf-blender-cvs] [0d027b45834] master: Fix RNA not giving error with invalid identifiers for collection properties

Brecht Van Lommel noreply at git.blender.org
Thu Nov 19 16:29:38 CET 2020


Commit: 0d027b45834fc47778cb553487962fd3461c7175
Author: Brecht Van Lommel
Date:   Thu Nov 19 16:26:48 2020 +0100
Branches: master
https://developer.blender.org/rB0d027b45834fc47778cb553487962fd3461c7175

Fix RNA not giving error with invalid identifiers for collection properties

===================================================================

M	source/blender/makesrna/intern/rna_define.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 8cc4f545ca9..03a61ccaa21 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -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;
 }



More information about the Bf-blender-cvs mailing list