Fix missing protection of `RNA_pointer_as_string()` against NULL pointers.

Odd that issue was never reached before? Looks like it hit in
datablock_idprops branch though...
This commit is contained in:
Bastien Montagne 2017-04-04 15:57:45 +02:00
parent 92aeb84fde
commit 9170e49250
1 changed files with 7 additions and 1 deletions

View File

@ -5547,6 +5547,9 @@ static char *rna_pointer_as_string__bldata(PointerRNA *ptr)
return BLI_strdup("None");
}
else if (RNA_struct_is_ID(ptr->type)) {
if (ptr->id.data == NULL) {
return BLI_strdup("None");
}
return RNA_path_full_ID_py(ptr->id.data);
}
else {
@ -5556,7 +5559,10 @@ static char *rna_pointer_as_string__bldata(PointerRNA *ptr)
char *RNA_pointer_as_string(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *prop_ptr, PointerRNA *ptr_prop)
{
if (RNA_property_flag(prop_ptr) & PROP_IDPROPERTY) {
if (ptr_prop->data == NULL) {
return BLI_strdup("None");
}
else if (RNA_property_flag(prop_ptr) & PROP_IDPROPERTY) {
return RNA_pointer_as_string_id(C, ptr_prop);
}
else {