diff options
author | Julian Eisel <julian@blender.org> | 2022-02-24 19:02:14 +0300 |
---|---|---|
committer | Fabian Schempp <fabianschempp@googlemail.com> | 2022-04-11 01:30:13 +0300 |
commit | edd7f167761fd2c640fadde8c3e3df914ef2932f (patch) | |
tree | ee050fc32b6c60a7cb0763eed92c2cf3896903f3 /source/blender/editors/space_outliner | |
parent | 4ca3386ccb001b22a3a5f8eed6a7b928b634910d (diff) |
Fix incorrect Outliner tree-display type returned
Reverts 6d97fdc37eef. A function like this should not return a different
tree-display object than of the requested type. This may hide errors,
and leaves the Outliner in an undefined state (where the stored display
mode doesn't match the tree-display object). I rather don't hide the
fact that all display-modes should be handled here, and emit a clear
error if one isn't.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/tree/tree_display.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/space_outliner/tree/tree_display.cc b/source/blender/editors/space_outliner/tree/tree_display.cc index 6b68f1ee4a4..f9141dffd6a 100644 --- a/source/blender/editors/space_outliner/tree/tree_display.cc +++ b/source/blender/editors/space_outliner/tree/tree_display.cc @@ -7,6 +7,8 @@ #include "DNA_listBase.h" #include "DNA_space_types.h" +#include "BLI_utildefines.h" + #include "tree_display.hh" using namespace blender::ed::outliner; @@ -30,11 +32,11 @@ std::unique_ptr<AbstractTreeDisplay> AbstractTreeDisplay::createFromDisplayMode( case SO_OVERRIDES_LIBRARY: return std::make_unique<TreeDisplayOverrideLibrary>(space_outliner); case SO_VIEW_LAYER: - /* FIXME(Julian): this should not be the default! Return nullptr and handle that as valid - * case. */ - default: return std::make_unique<TreeDisplayViewLayer>(space_outliner); } + + BLI_assert_unreachable(); + return nullptr; } bool AbstractTreeDisplay::hasWarnings() const |