From 990558bb34e95d950c8b2cef352a41edef6ff715 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Wed, 15 Jul 2020 16:56:09 +0200 Subject: [PATCH] Movestack can cause dwm to crash if there are no selections on the monitor --- patch/movestack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/patch/movestack.c b/patch/movestack.c index 2406a87..1fed29b 100644 --- a/patch/movestack.c +++ b/patch/movestack.c @@ -4,6 +4,8 @@ movestack(const Arg *arg) Client *c = NULL, *p = NULL, *pc = NULL, *i; if (arg->i > 0) { + if (!selmon->sel) + return; /* find the client after selmon->sel */ for (c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next); if (!c)