diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-07-23 21:40:33 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-08-12 09:46:39 +0300 |
commit | e48054ece47765c37f55af50922580ee1645f6df (patch) | |
tree | 307077b7c3dc4e04ac36ab4d5c318e1a0d631cfd | |
parent | b7a72778ecf3ea1de54e3a864ae0e37ab65d0b0c (diff) |
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.
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tools.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 8813af4c197..06135641f3c 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -789,11 +789,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) { |