[Bf-blender-cvs] [9cbf43801ba] blender-v2.90-release: Fix T79187: Outliner "Make Single User" crash

Nathan Craddock noreply at git.blender.org
Thu Jul 23 20:50:04 CEST 2020


Commit: 9cbf43801ba21b0b4aad0aaccf681ebc7e29cc04
Author: Nathan Craddock
Date:   Thu Jul 23 12:40:33 2020 -0600
Branches: blender-v2.90-release
https://developer.blender.org/rB9cbf43801ba21b0b4aad0aaccf681ebc7e29cc04

Fix T79187: Outliner "Make Single User" crash

When "ID Data" -> "Make Single User" is chosen with selected elements
that are not curves, there is a crash. This fix ensures that the id in the
callback function is an Action.

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 7515178e1d1..dae2ba32f09 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -867,11 +867,17 @@ static void id_select_linked_cb(bContext *C,
 static void singleuser_action_cb(bContext *C,
                                  ReportList *UNUSED(reports),
                                  Scene *UNUSED(scene),
-                                 TreeElement *UNUSED(te),
+                                 TreeElement *te,
                                  TreeStoreElem *tsep,
                                  TreeStoreElem *tselem,
                                  void *UNUSED(user_data))
 {
+  /* This callback runs for all selected elements, some of which may not be actions which results
+   * in a crash. */
+  if (te->idcode != ID_AC) {
+    return;
+  }
+
   ID *id = tselem->id;
 
   if (id) {



More information about the Bf-blender-cvs mailing list