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>2021-01-17 10:21:27 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-17 10:24:34 +0300
commitca476a638c89634c17a025eff184a81e92d13f50 (patch)
tree5193090fc8c1ffd59ae56937d15f50177bc2cdc2 /source/blender/makesrna/intern/rna_define.c
parent66a87fc9f47217d203b8aaa4e837d25737d0307a (diff)
RNA: report an error when the name property is set twice
This helps avoid copy-paste errors which have happened a few times, no functional changes.
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 44045dc5d2c..cec6a50d170 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -1125,6 +1125,11 @@ void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *pr
CLOG_ERROR(&LOG, "\"%s.%s\", must be a string property.", srna->identifier, prop->identifier);
DefRNA.error = true;
}
+ else if (srna->nameproperty != NULL) {
+ CLOG_ERROR(
+ &LOG, "\"%s.%s\", name property is already set.", srna->identifier, prop->identifier);
+ DefRNA.error = true;
+ }
else {
srna->nameproperty = prop;
}