aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-08-11 10:28:05 -0400
committerGitHub <noreply@github.com>2018-08-11 10:28:05 -0400
commitb6428f4751bd6df69d2ef17e628c0d28de1c0233 (patch)
tree795fe72b9de75bc7fae93b72d7c470d170d97b0d
parent2aa6d98c5a6d37c759e1e9cc84032a95fb193793 (diff)
parent5f3757c92763ce66c6cf043fdb22f3c12ce606cd (diff)
Merge pull request #2451 from RyanDwyer/fix-ancestor-crash
Fix container_has_ancestor crash
-rw-r--r--sway/tree/container.c2
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,
bool container_has_ancestor(struct sway_container *descendant,
struct sway_container *ancestor) {
- while (descendant->type != C_ROOT) {
+ while (descendant && descendant->type != C_ROOT) {
descendant = descendant->parent;
if (descendant == ancestor) {
return true;