[Bf-blender-cvs] [5c490bcbc82] master: Fix T85027: Crash dragging a collection over empty Outliner

Julian Eisel noreply at git.blender.org
Mon Jan 25 14:38:05 CET 2021


Commit: 5c490bcbc82b43487f2e08978b69f1900e8bfce5
Author: Julian Eisel
Date:   Mon Jan 25 14:34:57 2021 +0100
Branches: master
https://developer.blender.org/rB5c490bcbc82b43487f2e08978b69f1900e8bfce5

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.

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

M	source/blender/editors/space_outliner/outliner_dragdrop.c

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

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(
       &region->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]);



More information about the Bf-blender-cvs mailing list