Fix T75629: Disallow dragging collection instance into itself

Differential Revision: https://developer.blender.org/D7408
This commit is contained in:
Vincent Blankfield 2020-04-14 15:10:42 +02:00 committed by Jacques Lucke
parent 2ed2dd7b13
commit 50dd876fbf
Notes: blender-bot 2023-02-14 07:39:44 +01:00
Referenced by issue #75629, Stack overflow when a collection instance is a child of the original collection
1 changed files with 2 additions and 1 deletions

View File

@ -657,7 +657,8 @@ static bool collection_object_add(
{
if (ob->instance_collection) {
/* Cyclic dependency check. */
if (collection_find_child_recursive(ob->instance_collection, collection)) {
if (collection_find_child_recursive(ob->instance_collection, collection) ||
ob->instance_collection == collection) {
return false;
}
}