Awesomebar: dwm crashes on bar click with 0 clients

Clicking on the bar before any clients have been started results
in dwm crashing. This fix addresses that.
pull/32/head
bakkeby 4 years ago
parent e79aec52c2
commit 1bf50728a7

@ -937,11 +937,11 @@ buttonpress(XEvent *e)
c = m->clients;
do {
if (!ISVISIBLE(c))
if (!c || !ISVISIBLE(c))
continue;
else
x += (1.0 / (double)m->bt) * m->btw;
} while (ev->x > x && (c = c->next));
} while (c && ev->x > x && (c = c->next));
if (c) {
click = ClkWinTitle;

Loading…
Cancel
Save