From 2476faebd751fe7a250d7a496a1f56338b83d4e9 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Wed, 21 Sep 2016 14:47:40 +0200 Subject: [PATCH] Fix crash in space context cycling when leaving window bounds --- source/blender/editors/screen/screen_ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 7612dbc7f10..a6b6ccd5a66 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4191,7 +4191,8 @@ static EnumPropertyItem space_context_cycle_direction[] = { static int space_context_cycle_poll(bContext *C) { ScrArea *sa = CTX_wm_area(C); - return ELEM(sa->spacetype, SPACE_BUTS, SPACE_USERPREF); + /* sa might be NULL if called out of window bounds */ + return (sa && ELEM(sa->spacetype, SPACE_BUTS, SPACE_USERPREF)); } /**