diff options
author | Julian Eisel <julian@blender.org> | 2021-01-25 16:34:57 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-01-25 16:37:24 +0300 |
commit | 5c490bcbc82b43487f2e08978b69f1900e8bfce5 (patch) | |
tree | 66d641156b7ac8906ef78d2492c97e9d9db8ccd4 /source/blender/editors | |
parent | f226687bb963f54e47d56bca5c1ff00555fc09b6 (diff) |
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.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_dragdrop.c | 5 |
1 files changed, 5 insertions, 0 deletions
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]); |