Fix crash using "Copy to selected" on ID-props

This commit is contained in:
Campbell Barton 2015-03-18 18:50:33 +11:00
parent 2919519714
commit ff1ed872d9
Notes: blender-bot 2023-02-14 09:21:29 +01:00
Referenced by issue #44034, Copy to Selected crashes
1 changed files with 6 additions and 0 deletions

View File

@ -6517,6 +6517,12 @@ bool RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop,
/* In case of IDProperty, we have to find the *real* idprop of ptr,
* since prop in this case is just a fake wrapper around actual IDProp data, and not a 'real' PropertyRNA. */
prop = (PropertyRNA *)rna_idproperty_find(ptr, ((IDProperty *)fromprop)->name);
/* its possible the custom-prop doesn't exist on this datablock */
if (prop == NULL) {
return false;
}
/* Even though currently we now prop will always be the 'fromprop', this might not be the case in the future. */
if (prop == fromprop) {
fromprop = (PropertyRNA *)rna_idproperty_find(fromptr, ((IDProperty *)prop)->name);