From 1bf50728a7acaba9ed32d423b4118d52db274f39 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Wed, 27 May 2020 14:10:51 +0200 Subject: [PATCH] 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. --- dwm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dwm.c b/dwm.c index 17c95fd..15822f3 100644 --- a/dwm.c +++ b/dwm.c @@ -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;