Fix T47657: Using template_list() with invoke_props_dialog()
popups have no wm_region in context, using wm_menu here. Not working perfect, but at least it prevents crash.
This commit is contained in:
parent
8c2cec937b
commit
bd335f13fe
Notes:
blender-bot
2023-02-14 19:49:50 +01:00
Referenced by issue blender/blender-addons#47657, Using template_list() with invoke_props_dialog()
|
@ -2947,7 +2947,11 @@ void uiTemplateList(
|
|||
/* We tag the list id with the list type... */
|
||||
BLI_snprintf(ui_list_id, sizeof(ui_list_id), "%s_%s", ui_list_type->idname, list_id ? list_id : "");
|
||||
|
||||
ar = CTX_wm_region(C);
|
||||
/* Allows to work in popups. */
|
||||
ar = CTX_wm_menu(C);
|
||||
if (ar == NULL) {
|
||||
ar = CTX_wm_region(C);
|
||||
}
|
||||
ui_list = BLI_findstring(&ar->ui_lists, ui_list_id, offsetof(uiList, list_id));
|
||||
|
||||
if (!ui_list) {
|
||||
|
|
Loading…
Reference in New Issue