diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-09-14 11:58:47 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-09-14 11:58:47 +0300 |
commit | c57636f06001880022a4a091d20615ba527f2389 (patch) | |
tree | 34e5801010727bb346a836fc6c056a6d61a4251d /source | |
parent | d827186c17c98bbde418f134e562a99722a141c5 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index a95fe59348d..c21a76918e8 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -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) |