Page MenuHome
Paste P464

fix_d113_crash.diff
ActivePublic

Authored by Alexander Romanov (a.romanov) on Apr 14 2017, 2:32 PM.
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py
index c0d92c3..c36beb4 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -40,9 +40,13 @@ def rna_idprop_ui_del(item):
def rna_idprop_ui_prop_update(item, prop):
- prop_rna = item.path_resolve("[\"%s\"]" % prop.replace("\"", "\\\""), False)
- if isinstance(prop_rna, bpy.types.bpy_prop):
- prop_rna.update()
+ try:
+ prop_rna = item.path_resolve("[\"%s\"]" % prop.replace("\"", "\\\""), False)
+ if isinstance(prop_rna, bpy.types.bpy_prop):
+ prop_rna.update()
+ except ValueError:
+ # the case when datablock idproperty pointer is NULL
+ pass
def rna_idprop_ui_prop_get(item, prop, create=True):
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index c3d2d92..a299302 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -5599,12 +5599,13 @@ 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)
+char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop_ptr, PointerRNA *ptr_prop)
{
+ IDProperty *prop;
if (ptr_prop->data == NULL) {
return BLI_strdup("None");
}
- else if (RNA_property_flag(prop_ptr) & PROP_IDPROPERTY) {
+ else if ((prop = rna_idproperty_check(&prop_ptr, ptr)) && prop->type != IDP_ID) {
return RNA_pointer_as_string_id(C, ptr_prop);
}
else {