Fix failure in our UI code that could allow search button without search callbacks, leading to crash.
Related to (exposed by) T52735, fixes the reported crash but not the underlying issue. To be backported to 2.79a should we do one.
This commit is contained in:
parent
882fe36f0d
commit
e8e40b171b
|
@ -1726,6 +1726,10 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN
|
|||
|
||||
UI_but_func_search_set(but, ui_searchbox_create_generic, rna_search_cb, but, NULL, NULL);
|
||||
}
|
||||
else if (but->type == UI_BTYPE_SEARCH_MENU) {
|
||||
/* In case we fail to find proper searchprop, so other code might have already set but->type to search menu... */
|
||||
but->type = UI_BTYPE_LABEL;
|
||||
}
|
||||
}
|
||||
|
||||
void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, struct PointerRNA *searchptr, const char *searchpropname, const char *name, int icon)
|
||||
|
|
Loading…
Reference in New Issue