diff options
author | Julian Eisel <julian@blender.org> | 2021-03-11 15:19:25 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-03-11 15:20:27 +0300 |
commit | fade765bf3488676141b28556969130eef9b70bb (patch) | |
tree | 3e1f65f71fd39f803cd60cb09f27522287184295 /source/blender | |
parent | f59ff9e03a633f64f9587eb67eee7913fed685a8 (diff) |
Outliner: Add assert to make assumption for new code design explicit
There was an implicit assumption that tree element types using the new code
design set their name on creation. Use an assert to make this explicit. See
f59ff9e03a633, which was an error because of this broken assumption.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 6319b890b3b..36a9549c9b2 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -889,6 +889,10 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner, /* New C++ based type handle (`TreeElementType` in C, `AbstractTreeElement` in C++). Only some * support this, eventually this should replace `TreeElement` entirely. */ te->type = outliner_tree_element_type_create(type, te, idv); + if (te->type) { + /* Element types ported to the new design are expected to have their name set at this point! */ + BLI_assert(te->name != NULL); + } if (ELEM(type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) { /* pass */ |