diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-12 00:13:43 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-12 00:14:52 +1000 |
commit | 5f3757c92763ce66c6cf043fdb22f3c12ce606cd (patch) | |
tree | 795fe72b9de75bc7fae93b72d7c470d170d97b0d | |
parent | Merge pull request #2449 from RyanDwyer/remove-bfs (diff) | |
download | sway-5f3757c92763ce66c6cf043fdb22f3c12ce606cd.tar.gz sway-5f3757c92763ce66c6cf043fdb22f3c12ce606cd.tar.zst sway-5f3757c92763ce66c6cf043fdb22f3c12ce606cd.zip |
Fix container_has_ancestor crash
Fixes #2450
-rw-r--r-- | sway/tree/container.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 435d71e2..45e54080 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -769,7 +769,7 @@ void container_for_each_descendant(struct sway_container *container, | |||
769 | 769 | ||
770 | bool container_has_ancestor(struct sway_container *descendant, | 770 | bool container_has_ancestor(struct sway_container *descendant, |
771 | struct sway_container *ancestor) { | 771 | struct sway_container *ancestor) { |
772 | while (descendant->type != C_ROOT) { | 772 | while (descendant && descendant->type != C_ROOT) { |
773 | descendant = descendant->parent; | 773 | descendant = descendant->parent; |
774 | if (descendant == ancestor) { | 774 | if (descendant == ancestor) { |
775 | return true; | 775 | return true; |