Fix #117679: operator_menu_enum crashes for an unfound property #117691

Merged
Harley Acheson merged 1 commits from lichtwerk/blender:117679 into main 2024-02-01 01:51:04 +01:00
1 changed files with 3 additions and 0 deletions

View File

@ -3602,6 +3602,9 @@ static int menu_item_enum_opname_menu_active(bContext *C, uiBut *but, MenuItemLe
/* so the context is passed to itemf functions (some need it) */
WM_operator_properties_sanitize(&ptr, false);
PropertyRNA *prop = RNA_struct_find_property(&ptr, lvl->propname);
if (!prop) {
return -1;
}
RNA_property_enum_items_gettexted(C, &ptr, prop, &item_array, &totitem, &free);
int active = RNA_enum_from_name(item_array, but->str.c_str());
if (free) {