aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authorMateuszOkulus <[email protected]>2020-05-12 16:48:47 +0200
committerMateuszOkulus <[email protected]>2020-05-12 16:48:47 +0200
commitddb3992e8b46d7f78887f3cf7b0bf2363b82d16f (patch)
treec1813e8cff5934997a0a405fe792bf2240e8a7fe /dwm.c
parentMerge pull request #64 from cm-mcl/master (diff)
downloadseiwm-ddb3992e8b46d7f78887f3cf7b0bf2363b82d16f.tar.xz
seiwm-ddb3992e8b46d7f78887f3cf7b0bf2363b82d16f.zip
Fix crashes when stack is empty
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index 242909e..c58300f 100644
--- a/dwm.c
+++ b/dwm.c
@@ -990,7 +990,7 @@ focusstack(const Arg *arg)
int i = stackpos(arg);
Client *c, *p;
- if (i < 0 || selmon->sel->isfullscreen)
+ if (i < 0 || !selmon->sel || selmon->sel->isfullscreen)
return;
for(p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c));
@@ -1404,7 +1404,7 @@ pushstack(const Arg *arg) {
int i = stackpos(arg);
Client *sel = selmon->sel, *c, *p;
- if(i < 0)
+ if(i < 0 || !sel)
return;
else if(i == 0) {
detach(sel);