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
This commit is contained in:
Philipp Oeser
2019-07-29 12:40:49 +02:00
parent baff245b9d
commit 0ae52711b6

View 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 "