Fix for crash getting the name of RNA properties with empty name

This commit is contained in:
Campbell Barton 2014-01-24 00:25:11 +11:00
parent 536800392a
commit 64bd4be6b2
1 changed files with 2 additions and 2 deletions

View File

@ -465,14 +465,14 @@ static void rna_Property_name_get(PointerRNA *ptr, char *value)
{
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, prop->name);
strcpy(value, prop->name ? prop->name : "");
}
static int rna_Property_name_length(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return strlen(prop->name);
return prop->name ? strlen(prop->name) : 0;
}
static void rna_Property_description_get(PointerRNA *ptr, char *value)