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:
Bastien Montagne
2016-05-06 21:56:54 +02:00
parent 8c2cec937b
commit bd335f13fe

View File

@@ -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) {