diff options
author | Julian Eisel <julian@blender.org> | 2022-02-24 19:02:14 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-02-24 19:10:19 +0300 |
commit | 17301a3163c9b44c42f8032a575681a0c9fa1b8c (patch) | |
tree | 7627c49593b0be3fa4cceee04cb71a0450362927 /source/blender/editors/space_outliner | |
parent | fc8aab755ad626198b279adc2f56158c4812537f (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 |