focus(Client *c) function is now safer if the client is not attached

This commit is contained in:
Anselm R. Garbe 2006-03-09 12:38:02 +01:00
parent de2c95793e
commit 1f64e630ca
1 changed files with 7 additions and 2 deletions

View File

@ -532,8 +532,13 @@ resize_all_clients()
void
focus(Client *c)
{
Frame *f = c->frame[c->sel];
Tag *t = f->area->tag;
Frame *f = c->nframe ? c->frame[c->sel] : nil;
Tag *t;
if(!f)
return;
t = f->area->tag;
if(tag[sel] != t)
focus_tag(t);
focus_client(c);