]> git.lizzy.rs Git - bspwm.git/commitdiff
Fix missing NULL check
authorCampbell Barton <ideasman42@gmail.com>
Mon, 11 Apr 2016 20:09:15 +0000 (06:09 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 11 Apr 2016 20:09:15 +0000 (06:09 +1000)
could crash when windows were unmapped within a script.

tree.c

diff --git a/tree.c b/tree.c
index 5d2b47c223c2e0d439cbcc66547bfebed0eb3043..10c3caaafc48cfaf1da2694beea08ae084d09db8 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -1637,7 +1637,7 @@ bool set_layer(monitor_t *m, desktop_t *d, node_t *n, stack_layer_t l)
 
 bool set_state(monitor_t *m, desktop_t *d, node_t *n, client_state_t s)
 {
-       if (n == NULL || n->client->state == s) {
+       if (n == NULL || n->client == NULL || n->client->state == s) {
                return false;
        }