From 5c490bcbc82b43487f2e08978b69f1900e8bfce5 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Mon, 25 Jan 2021 14:34:57 +0100 Subject: [PATCH] Fix T85027: Crash dragging a collection over empty Outliner Filtering may make the Outliner tree empty. The function to find the drop element should just return null then and let the caller decide how to deal with it. --- source/blender/editors/space_outliner/outliner_dragdrop.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c index ab515c0c3a8..467802d181b 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.c +++ b/source/blender/editors/space_outliner/outliner_dragdrop.c @@ -140,6 +140,11 @@ static TreeElement *outliner_drop_insert_find(bContext *C, TreeElement *te_hovered; float view_mval[2]; + /* Emtpy tree, e.g. while filtered. */ + if (BLI_listbase_is_empty(&space_outliner->tree)) { + return NULL; + } + UI_view2d_region_to_view( ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); te_hovered = outliner_find_item_at_y(space_outliner, &space_outliner->tree, view_mval[1]);