Don't try to find the ancestors of NULL

Fixes #1089.
This commit is contained in:
Bastien Dejean 2020-07-26 15:34:37 +02:00
parent dc303be2cc
commit c59491c19e

View 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)) {