more find_or_start error checking

This commit is contained in:
seanpringle
2012-09-13 15:50:20 +10:00
parent 3b65de394b
commit 5750bf8fee

7
xoat.c
View File

@@ -513,8 +513,9 @@ void action_find_or_start(void *data, int num, client *cli)
{ {
int i; client *c; char *class = data; int i; client *c; char *class = data;
for_windows(i, c) if (c->manage && !strcasecmp(c->class, class)) for_windows(i, c)
{ client_activate(c); return; } if (c->visible && c->manage && c->class && !strcasecmp(c->class, class))
{ client_activate(c); return; }
exec_cmd(class); exec_cmd(class);
} }
@@ -579,7 +580,7 @@ void action_rollback(void *data, int num, client *cli)
for (i = snapshot.depth-1; i > -1; i--) for (i = snapshot.depth-1; i > -1; i--)
{ {
if ((s = snapshot.clients[i]) && (c = window_build_client(s->window)) if ((s = snapshot.clients[i]) && (c = window_build_client(s->window))
&& !strcmp(s->class, c->class) && c->visible && c->manage) && c->class && !strcmp(s->class, c->class) && c->visible && c->manage)
{ {
client_place_spot(c, s->spot, s->monitor, 1); client_place_spot(c, s->spot, s->monitor, 1);
client_raise_family(c); client_raise_family(c);