diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-01-09 21:51:50 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-01-09 21:51:50 +0300 |
commit | 0f6ed7d1112dcb1610f419b24651840640f1a68b (patch) | |
tree | 4327ec2cd4162279c027fb9eb9b36b23885d93e1 | |
parent | 5fe87a0a8c7d9be3b913d9e8e0decb314cf5301d (diff) |
Fix (unreported) potential crash.
RNA_pointer_as_string could return NULL instead of a valid string in some cases.
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 1f974f3a440..b0a77f9b90a 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -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 { |