Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-01-14 07:36:12 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-14 07:36:12 +0300
commitaf4ab8c6a1d73eec4adce9a5847b1780cc39f2f6 (patch)
tree0ea0ba33871d1933eac6996a2381cc71bb340a28 /source/blender/editors/space_outliner
parent65b82e09d94e77f7d8fb079f24fe82aee8e2509e (diff)
Fix T60248: Crash duplicating collections
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.c7
1 files changed, 6 insertions, 1 deletions
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;