[Bf-blender-cvs] [0ae52711b6b] master: Fix T67857: crash assigning None to the data of an empty using python

Philipp Oeser noreply at git.blender.org
Mon Jul 29 15:29:58 CEST 2019


Commit: 0ae52711b6b86a40e6aae989e6fb84f5803a9e74
Author: Philipp Oeser
Date:   Mon Jul 29 12:40:49 2019 +0200
Branches: master
https://developer.blender.org/rB0ae52711b6b86a40e6aae989e6fb84f5803a9e74

Fix T67857: crash assigning None to the data of an empty using python

Assigning None is allowed for (image) empties.

Reviewers: sergey

Maniphest Tasks: T67857

Differential Revision: https://developer.blender.org/D5362

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

M	source/blender/makesrna/intern/rna_object.c

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

diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index d3b532dd11d..7fa1544d809 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -441,7 +441,7 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value, struct Report
     return;
   }
 
-  if ((id->tag & LIB_TAG_NO_MAIN) != (ob->id.tag & LIB_TAG_NO_MAIN)) {
+  if (id && ((id->tag & LIB_TAG_NO_MAIN) != (ob->id.tag & LIB_TAG_NO_MAIN))) {
     BKE_report(reports,
                RPT_ERROR,
                "Can only assign evaluated data to evaluated object, or original data to "



More information about the Bf-blender-cvs mailing list