Fix (unreported) potential crash.

RNA_pointer_as_string could return NULL instead of a valid string in some cases.
This commit is contained in:
Bastien Montagne 2018-01-09 19:51:50 +01:00
parent 5fe87a0a8c
commit 0f6ed7d111
1 changed files with 1 additions and 4 deletions

View File

@ -5745,13 +5745,10 @@ char *RNA_pointer_as_string_id(bContext *C, PointerRNA *ptr)
static char *rna_pointer_as_string__bldata(PointerRNA *ptr)
{
if (ptr->type == NULL) {
if (ptr->type == NULL || ptr->id.data == NULL) {
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 {