From aa7c1cdb7f165c564622ee3231dc75f34d80dd16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 17 Dec 2019 15:55:48 +0100 Subject: UI: Prevent crash when opening file browser with mouse not in window When the mouse is not inside the Blender window, `CTX_wm_area(C)` returns `NULL`, but this wasn't checked for. --- source/blender/editors/screen/screen_edit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 5b8fd33a4e9..501c36286d0 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1389,13 +1389,13 @@ ScrArea *ED_screen_temp_space_open(bContext *C, case USER_TEMP_SPACE_DISPLAY_FULLSCREEN: { ScrArea *ctx_sa = CTX_wm_area(C); - if (ctx_sa->full) { + if (ctx_sa != NULL && ctx_sa->full) { sa = ctx_sa; ED_area_newspace(C, ctx_sa, space_type, true); sa->flag |= AREA_FLAG_STACKED_FULLSCREEN; ((SpaceLink *)sa->spacedata.first)->link_flag |= SPACE_FLAG_TYPE_TEMPORARY; } - else if (ctx_sa->spacetype == space_type) { + else if (ctx_sa != NULL && ctx_sa->spacetype == space_type) { sa = ED_screen_state_toggle(C, CTX_wm_window(C), ctx_sa, SCREENMAXIMIZED); } else { -- cgit v1.2.3