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.
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user