commit 7870a197fcdf4d6e77bea7133539d6637aba8479
parent 3ce8cc807753119104d8836b6c77e19fd644a878
Author: Hummer12007 <hilobakho@gmail.com>
Date: Sat, 18 Jun 2016 20:31:18 +0300
Added a null check in tabbed_stacked_parent
This fixes a segfault, when trying to get parent of the workspace/root container/(?), as it is not assuered that the view's parent node is not null in the loop
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sway/container.c b/sway/container.c
@@ -853,12 +853,12 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) {
if (!ASSERT_NONNULL(view)) {
return NULL;
}
- do {
+ while (view->type != C_WORKSPACE && view->parent) {
view = view->parent;
if (view->layout == L_TABBED || view->layout == L_STACKED) {
parent = view;
}
- } while (view && view->type != C_WORKSPACE);
+ }
return parent;
}