From 732f70a151c47dc55e9da33c0bf346764bb54ab6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 31 Aug 2017 18:42:48 +1000 Subject: RNA: existing type check used wrong identifier Own error in recent type checks, in many cases the 'idname' is used for the struct identifier, not the 'identifier' which is the Python class name in this context. --- source/blender/makesrna/intern/rna_nodetree.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'source/blender/makesrna/intern/rna_nodetree.c') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index f15605d0f83..1c7d7816f0f 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -633,7 +633,7 @@ static StructRNA *rna_NodeTree_register( if (nt) { rna_NodeTree_unregister(bmain, nt->ext.srna); } - if (!RNA_struct_available_or_report(reports, identifier)) { + if (!RNA_struct_available_or_report(reports, dummynt.idname)) { return NULL; } @@ -1393,16 +1393,13 @@ 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) { rna_Node_unregister(bmain, nt->ext.srna); } - if (!RNA_struct_available_or_report(reports, identifier)) { + if (!RNA_struct_available_or_report(reports, dummynt.idname)) { return NULL; } -- cgit v1.2.3