add protections to movestack function - prevents crash

This commit is contained in:
Jakub 2024-07-20 01:09:20 -04:00
parent 47484739cf
commit 794d700043

2
dwm.c
View File

@ -1833,6 +1833,8 @@ nexttiled(Client *c)
void void
movestack(const Arg *arg) { movestack(const Arg *arg) {
Client *c = NULL, *p = NULL, *pc = NULL, *i; Client *c = NULL, *p = NULL, *pc = NULL, *i;
if (!selmon->sel)
return;
if(arg->i > 0) { if(arg->i > 0) {
/* find the client after selmon->sel */ /* find the client after selmon->sel */