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.
This commit is contained in:
bakkeby 2020-05-27 14:10:51 +02:00
parent e79aec52c2
commit 1bf50728a7

4
dwm.c
View File

@ -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;