diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-23 07:59:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-23 08:02:21 +0300 |
commit | 1e60ac33949ae533857fc6a48ce5fbc2402dd060 (patch) | |
tree | f3653899ca70880ec4c5b8438c15d16e85e60147 /source/blender/makesrna/intern/rna_animation.c | |
parent | 4761dea573f6fa9a57150596098c17f723d3a49f (diff) |
RNA: report error on struct naming collision
Fixes T52463, error instead of crash.
Diffstat (limited to 'source/blender/makesrna/intern/rna_animation.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_animation.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index f271bccd326..b0a51fd8c73 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -270,9 +270,13 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v /* check if we have registered this info before, and remove it */ ksi = ANIM_keyingset_info_find_name(dummyksi.idname); - if (ksi && ksi->ext.srna) + if (ksi && ksi->ext.srna) { rna_KeyingSetInfo_unregister(bmain, ksi->ext.srna); - + } + if (!RNA_struct_available_or_report(reports, identifier)) { + return NULL; + } + /* create a new KeyingSetInfo type */ ksi = MEM_callocN(sizeof(KeyingSetInfo), "python keying set info"); memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo)); |