fix for crash in recent changes, missing NULL check

This commit is contained in:
Campbell Barton 2012-12-18 17:06:31 +00:00
parent 63731453e2
commit e0d585b6c9

@ -615,13 +615,17 @@ static char *wm_prop_pystring_from_context(bContext *C, PointerRNA *ptr, Propert
if (member_found) { if (member_found) {
prop_str = RNA_path_property_py(ptr, prop, index); prop_str = RNA_path_property_py(ptr, prop, index);
ret = BLI_sprintfN("bpy.context.%s.%s", member_found, prop_str); if (prop_str) {
MEM_freeN(prop_str); ret = BLI_sprintfN("bpy.context.%s.%s", member_found, prop_str);
MEM_freeN(prop_str);
}
} }
else if (member_id) { else if (member_id) {
prop_str = RNA_path_struct_property_py(ptr, prop, index); prop_str = RNA_path_struct_property_py(ptr, prop, index);
ret = BLI_sprintfN("bpy.context.%s.%s", member_id, prop_str); if (prop_str) {
MEM_freeN(prop_str); ret = BLI_sprintfN("bpy.context.%s.%s", member_id, prop_str);
MEM_freeN(prop_str);
}
} }
BLI_freelistN(&lb); BLI_freelistN(&lb);