Merge pull request #66 from mokulus/stack-fix
Fix crashes when stack is empty
This commit is contained in:
commit
ed5803de18
1 changed files with 2 additions and 2 deletions
4
dwm.c
4
dwm.c
|
@ -990,7 +990,7 @@ focusstack(const Arg *arg)
|
||||||
int i = stackpos(arg);
|
int i = stackpos(arg);
|
||||||
Client *c, *p;
|
Client *c, *p;
|
||||||
|
|
||||||
if (i < 0 || selmon->sel->isfullscreen)
|
if (i < 0 || !selmon->sel || selmon->sel->isfullscreen)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for(p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c));
|
for(p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c));
|
||||||
|
@ -1404,7 +1404,7 @@ pushstack(const Arg *arg) {
|
||||||
int i = stackpos(arg);
|
int i = stackpos(arg);
|
||||||
Client *sel = selmon->sel, *c, *p;
|
Client *sel = selmon->sel, *c, *p;
|
||||||
|
|
||||||
if(i < 0)
|
if(i < 0 || !sel)
|
||||||
return;
|
return;
|
||||||
else if(i == 0) {
|
else if(i == 0) {
|
||||||
detach(sel);
|
detach(sel);
|
||||||
|
|
Loading…
Reference in a new issue