diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-11 16:14:44 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-11 16:14:44 +0300 |
commit | a3f9862262c0ef192ece6ca8241b67cda9925b32 (patch) | |
tree | 8399f627b312749937f0cc79e2693bced9ede6e9 /source/blender/editors/space_outliner/outliner_draw.cc | |
parent | b9d02b9cede338117179897fdcc2d3b1f7499cb3 (diff) |
Fix (unreported) crash in Outliner Overrides Properties view in invalid cases.
We cannot try to get RNA info when the rna path of an override property
is invalid.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_draw.cc')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.cc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index d898be4eb2c..36e21cf51a5 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -1808,6 +1808,25 @@ static void outliner_draw_overrides_rna_buts(uiBlock *block, TreeElementOverridesProperty &override_elem = *tree_element_cast<TreeElementOverridesProperty>( te); + if (!override_elem.is_rna_path_valid) { + uiBut *but = uiDefBut(block, + UI_BTYPE_LABEL, + 0, + override_elem.rna_path.c_str(), + x + pad_x, + te->ys + pad_y, + item_max_width, + item_height, + NULL, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + ""); + UI_but_flag_enable(but, UI_BUT_REDALERT); + continue; + } + PointerRNA *ptr = &override_elem.override_rna_ptr; PropertyRNA *prop = &override_elem.override_rna_prop; const PropertyType prop_type = RNA_property_type(prop); @@ -1935,8 +1954,9 @@ static bool outliner_draw_overrides_warning_buts(uiBlock *block, break; } case TSE_LIBRARY_OVERRIDE: { - const bool is_rna_path_valid = (bool)(POINTER_AS_UINT(te->directdata)); - if (!is_rna_path_valid) { + TreeElementOverridesProperty &te_override_prop = + *tree_element_cast<TreeElementOverridesProperty>(te); + if (!te_override_prop.is_rna_path_valid) { item_has_warnings = true; if (do_draw) { tip = TIP_( |