[Bf-blender-cvs] [78f1476d931] datablock_idprops: Some more cleanup, get rid of hack to protect against NULL RNA pointerprops.

Bastien Montagne noreply at git.blender.org
Tue Apr 4 16:23:37 CEST 2017


Commit: 78f1476d931279407786e43e91aa17581a545699
Author: Bastien Montagne
Date:   Tue Apr 4 16:13:55 2017 +0200
Branches: datablock_idprops
https://developer.blender.org/rB78f1476d931279407786e43e91aa17581a545699

Some more cleanup, get rid of hack to protect against NULL RNA pointerprops.

===================================================================

M	source/blender/makesrna/intern/rna_access.c
M	source/blender/python/intern/bpy_props.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index c9318756b13..44f674c6187 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -5878,9 +5878,6 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop, in
 		case PROP_POINTER:
 		{
 			PointerRNA tptr = RNA_property_pointer_get(ptr, prop);
-			if (!tptr.data)
-				break;
-
 			cstring = RNA_pointer_as_string(C, ptr, prop, &tptr);
 			BLI_dynstr_append(dynstr, cstring);
 			MEM_freeN(cstring);
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index e01078b287f..4a0d2011fc3 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -2907,8 +2907,8 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
 			return NULL;
 		if (!RNA_struct_is_a(ptype, &RNA_PropertyGroup) && !RNA_struct_is_ID(ptype)) {
 			PyErr_Format(PyExc_TypeError,
-			"PointerProperty(...) expected an RNA type derived from %.200s or %.200s",
-			RNA_struct_ui_name(&RNA_ID), RNA_struct_ui_name(&RNA_PropertyGroup));
+			             "PointerProperty(...) expected an RNA type derived from %.200s or %.200s",
+			             RNA_struct_ui_name(&RNA_ID), RNA_struct_ui_name(&RNA_PropertyGroup));
 			return NULL;
 		}
 		if (bpy_prop_callback_check(update_cb, "update", 2) == -1) {




More information about the Bf-blender-cvs mailing list