Fix: don't use nullptr for std::optional<StringRefNull>

`StringRefNull` cannot reference a `nullptr` string, and so
`uiDefAutoButR()` should get a `std::nullopt` instead of `nullptr`.

Pull Request: https://projects.blender.org/blender/blender/pulls/132852
This commit is contained in:
Sybren A. Stüvel
2025-01-09 15:37:36 +01:00
parent 971c96a92c
commit c104fa95d9
2 changed files with 3 additions and 2 deletions

View File

@@ -6248,7 +6248,8 @@ void ANIM_channel_draw_widgets(const bContext *C,
&ptr,
prop,
array_index,
RNA_property_type(prop) == PROP_ENUM ? nullptr : "",
RNA_property_type(prop) == PROP_ENUM ? std::nullopt :
std::optional(""),
ICON_NONE,
offset,
rect->ymin,

View File

@@ -1950,7 +1950,7 @@ static void outliner_draw_overrides_rna_buts(uiBlock *block,
ptr,
prop,
-1,
(prop_type == PROP_ENUM) ? nullptr : "",
(prop_type == PROP_ENUM) ? std::nullopt : std::optional(""),
ICON_NONE,
x + pad_x,
te->ys + pad_y,