Movestack can cause dwm to crash if there are no selections on the monitor

This commit is contained in:
bakkeby
2020-07-15 16:56:09 +02:00
parent 38c77b06f0
commit 990558bb34

View File

@ -4,6 +4,8 @@ movestack(const Arg *arg)
Client *c = NULL, *p = NULL, *pc = NULL, *i; Client *c = NULL, *p = NULL, *pc = NULL, *i;
if (arg->i > 0) { if (arg->i > 0) {
if (!selmon->sel)
return;
/* find the client after selmon->sel */ /* find the client after selmon->sel */
for (c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next); for (c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
if (!c) if (!c)