Fix crash in space context cycling when leaving window bounds

This commit is contained in:
Julian Eisel 2016-09-21 14:47:40 +02:00
parent bb6af17799
commit 2476faebd7
1 changed files with 2 additions and 1 deletions

View File

@ -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));
}
/**