Fixed possible segfault on select up/down in an empty view

This commit is contained in:
Kris Maglione 2006-06-22 04:07:19 -04:00
parent 3b8f3334d0
commit f00cbec38e

View File

@ -109,6 +109,8 @@ select_area(Area *a, char *arg)
new = a->next ? a->next : a;
}
else if(!strncmp(arg, "up", 3)) {
if(!f)
return Ebadvalue;
for(p=a->frame; p->anext; p=p->anext)
if(p->anext == f) break;
focus_client(p->client, True);
@ -116,6 +118,8 @@ select_area(Area *a, char *arg)
return nil;
}
else if(!strncmp(arg, "down", 5)) {
if(!f)
return Ebadvalue;
p = f->anext ? f->anext : a->frame;
focus_client(p->client, True);
flush_masked_events(EnterWindowMask);