[Bf-blender-cvs] [af4ab8c6a1d] master: Fix T60248: Crash duplicating collections
Campbell Barton
noreply at git.blender.org
Mon Jan 14 05:59:38 CET 2019
Commit: af4ab8c6a1d73eec4adce9a5847b1780cc39f2f6
Author: Campbell Barton
Date: Mon Jan 14 15:36:12 2019 +1100
Branches: master
https://developer.blender.org/rBaf4ab8c6a1d73eec4adce9a5847b1780cc39f2f6
Fix T60248: Crash duplicating collections
===================================================================
M source/blender/editors/space_outliner/outliner_collections.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index 4ff818f793a..cb30c9df181 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -441,7 +441,12 @@ static int collection_duplicate_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
SpaceOops *soops = CTX_wm_space_outliner(C);
TreeElement *te = outliner_active_collection(C);
- BLI_assert(te != NULL);
+
+ /* Can happen when calling from a key binding. */
+ if (te == NULL) {
+ BKE_report(op->reports, RPT_ERROR, "No active collection");
+ return OPERATOR_CANCELLED;
+ }
Collection *collection = outliner_collection_from_tree_element(te);
Collection *parent = (te->parent) ? outliner_collection_from_tree_element(te->parent) : NULL;
More information about the Bf-blender-cvs
mailing list