Commit: d56444392f41e5115bb001af9fa50747f6295834
Author: Bastien Montagne
Date:   Thu Jun 18 20:34:02 2020 +0200
Branches: master
https://developer.blender.org/rBd56444392f41e5115bb001af9fa50747f6295834

Fix T78004: Instant crash when Shift+D duplicating a Collection Instance.

Dummy mistake in own recent refactor of duplicate code...

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

M       source/blender/blenkernel/intern/object.c

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

diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index 7385fbf3f33..6d9dd573b3c 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1804,7 +1804,7 @@ Object *BKE_object_duplicate(Main *bmain,
 
   ID *id = obn->data;
   ID *id_new = NULL;
-  const bool need_to_duplicate_obdata = (id->newid == NULL);
+  const bool need_to_duplicate_obdata = (id != NULL) && (id->newid == NULL);
 
   switch (obn->type) {
     case OB_MESH:

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to