]> git.lizzy.rs Git - bspwm.git/commitdiff
Don't try to find the ancestors of NULL
authorBastien Dejean <nihilhill@gmail.com>
Sun, 26 Jul 2020 13:34:37 +0000 (15:34 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Sun, 26 Jul 2020 13:34:37 +0000 (15:34 +0200)
Fixes #1089.

src/tree.c

index 2441e9100db2702a4c1ff991bd89b30980636497..728f72d9cfe086b14265f6111caea12085266c96 100644 (file)
@@ -1016,6 +1016,10 @@ bool find_any_node_in(monitor_t *m, desktop_t *d, node_t *n, coordinates_t *ref,
 
 void find_first_ancestor(coordinates_t *ref, coordinates_t *dst, node_select_t *sel)
 {
+       if (ref->node == NULL) {
+               return;
+       }
+
        coordinates_t loc = {ref->monitor, ref->desktop, ref->node};
        while ((loc.node = loc.node->parent) != NULL) {
                if (node_matches(&loc, ref, sel)) {