Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-08-23 07:59:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-23 08:02:21 +0300
commit1e60ac33949ae533857fc6a48ce5fbc2402dd060 (patch)
treef3653899ca70880ec4c5b8438c15d16e85e60147 /source/blender/makesrna/intern/rna_nodetree.c
parent4761dea573f6fa9a57150596098c17f723d3a49f (diff)
RNA: report error on struct naming collision
Fixes T52463, error instead of crash.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 00b881dabc7..f15605d0f83 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -630,9 +630,13 @@ static StructRNA *rna_NodeTree_register(
/* check if we have registered this tree type before, and remove it */
nt = ntreeTypeFind(dummynt.idname);
- if (nt)
+ if (nt) {
rna_NodeTree_unregister(bmain, nt->ext.srna);
-
+ }
+ if (!RNA_struct_available_or_report(reports, identifier)) {
+ return NULL;
+ }
+
/* create a new node tree type */
nt = MEM_callocN(sizeof(bNodeTreeType), "node tree type");
memcpy(nt, &dummynt, sizeof(dummynt));
@@ -1389,11 +1393,18 @@ static bNodeType *rna_Node_register_base(Main *bmain, ReportList *reports, Struc
identifier, (int)sizeof(dummynt.idname));
return NULL;
}
+ if (!RNA_struct_available_or_report(reports, identifier)) {
+ return NULL;
+ }
/* check if we have registered this node type before, and remove it */
nt = nodeTypeFind(dummynt.idname);
- if (nt)
+ if (nt) {
rna_Node_unregister(bmain, nt->ext.srna);
+ }
+ if (!RNA_struct_available_or_report(reports, identifier)) {
+ return NULL;
+ }
/* create a new node type */
nt = MEM_callocN(sizeof(bNodeType), "node type");