Fix (unreported) annoying UI assert for expanded enums.

All buttons will get their own block's `func` by default, this cannot be
considered an error, do not assert in that case either.

Fixes bunch of very annoying asserts e.g. when using FBX exporter...
This commit is contained in:
Bastien Montagne 2019-05-11 15:35:48 +02:00
parent f28b4c304c
commit 741e8cc118
Notes: blender-bot 2023-04-14 09:18:04 +02:00
Referenced by issue #62918, Calling the FBX Exporter stops Blender when it runs in Debug mode
1 changed files with 2 additions and 1 deletions

View File

@ -764,7 +764,8 @@ static void ui_item_enum_expand_elem_exec(uiLayout *layout,
if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
/* If this is set, assert since we're clobbering someone elses callback. */
BLI_assert(but->func == NULL);
/* Buttons get their block's func by default, so we cannot assert in that case either. */
BLI_assert(ELEM(but->func, NULL, block->func));
UI_but_func_set(but, ui_item_enum_expand_handle, but, POINTER_FROM_INT(value));
}