[Bf-blender-cvs] [aa7c1cdb7f1] master: UI: Prevent crash when opening file browser with mouse not in window
Sybren A. Stüvel
noreply at git.blender.org
Tue Dec 17 15:56:11 CET 2019
Commit: aa7c1cdb7f165c564622ee3231dc75f34d80dd16
Author: Sybren A. Stüvel
Date: Tue Dec 17 15:55:48 2019 +0100
Branches: master
https://developer.blender.org/rBaa7c1cdb7f165c564622ee3231dc75f34d80dd16
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.
===================================================================
M source/blender/editors/screen/screen_edit.c
===================================================================
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 {
More information about the Bf-blender-cvs
mailing list