diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-09-24 14:10:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-09-24 14:10:02 +0300 |
commit | 2b5733ff0122859b713ad9199d715add496c1608 (patch) | |
tree | cba2774e63b3e6f01cc540350e4f12020f4b193a /source/blender | |
parent | dfe01628b02725471a11e3afc825063b93ab392f (diff) |
Fix T91192: Context.copy() crashes on file load
The `ui_list` lookup from 87c1c8112fa44ccb94a3e996b7499d6577d85d7f
didn't account for the region being unset.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/screen/screen_context.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 2ccefb993c7..3d447d90626 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -1073,9 +1073,14 @@ static eContextResult screen_ctx_ui_list(const bContext *C, bContextDataResult * { wmWindow *win = CTX_wm_window(C); ARegion *region = CTX_wm_region(C); - uiList *list = UI_list_find_mouse_over(region, win->eventstate); - CTX_data_pointer_set(result, NULL, &RNA_UIList, list); - return CTX_RESULT_OK; + if (region) { + uiList *list = UI_list_find_mouse_over(region, win->eventstate); + if (list) { + CTX_data_pointer_set(result, NULL, &RNA_UIList, list); + return CTX_RESULT_OK; + } + } + return CTX_RESULT_NO_DATA; } /* Registry of context callback functions. */ |