Fix T67857: crash assigning None to the data of an empty using python
authorPhilipp Oeser <info@graphics-engineer.com>
Mon, 29 Jul 2019 10:40:49 +0000 (12:40 +0200)
committerPhilipp Oeser <info@graphics-engineer.com>
Mon, 29 Jul 2019 13:28:00 +0000 (15:28 +0200)
Assigning None is allowed for (image) empties.

Reviewers: sergey

Maniphest Tasks: T67857

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

source/blender/makesrna/intern/rna_object.c

index d3b532dd11d61db68c7a4bf36b17113534151a52..7fa1544d8090a6f6c2cd51db17bb177101854e25 100644 (file)
@@ -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 "