Commit: a9ee8d49b4fba40f5b5fa4f4abb132ec05bf2f19
Author: Nathan Craddock
Date:   Tue Jul 2 10:48:32 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBa9ee8d49b4fba40f5b5fa4f4abb132ec05bf2f19

Outliner: Fix crash on range select when no active element exists

The old code incorrectly assumed that an active element always
existed. The fix is to set the cursor element to active when
no active element is found.

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_select.c 
b/source/blender/editors/space_outliner/outliner_select.c
index b87d517adf1..861028e1c8c 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1278,6 +1278,12 @@ static void do_outliner_range_select_recursive(ListBase 
*lb,
 static void do_outliner_range_select(SpaceOutliner *soops, TreeElement *cursor)
 {
   TreeElement *active = outliner_find_active_element(&soops->tree);
+
+  if (!active) {
+    TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE;
+    return;
+  }
+
   TreeStoreElem *tselem = TREESTORE(active);
   const bool active_selected = (tselem->flag & TSE_SELECTED);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to