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
f59ff9e03a, which was an error because of this broken assumption.
This commit is contained in:
Julian Eisel 2021-03-11 13:19:25 +01:00
parent f59ff9e03a
commit fade765bf3
1 changed files with 4 additions and 0 deletions

View File

@ -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 */