diff options
author | 2016-06-18 20:31:18 +0300 | |
---|---|---|
committer | 2016-06-18 20:40:39 +0300 | |
commit | 7870a197fcdf4d6e77bea7133539d6637aba8479 (patch) | |
tree | 2591149dea0536a66624d9c1555c4ee15292aaec /sway | |
parent | Merge pull request #709 from zandrmartin/set-size-command (diff) | |
download | sway-7870a197fcdf4d6e77bea7133539d6637aba8479.tar.gz sway-7870a197fcdf4d6e77bea7133539d6637aba8479.tar.zst sway-7870a197fcdf4d6e77bea7133539d6637aba8479.zip |
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 (limited to 'sway')
-rw-r--r-- | sway/container.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/container.c b/sway/container.c index 15975064..21538ab4 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -853,12 +853,12 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) { | |||
853 | if (!ASSERT_NONNULL(view)) { | 853 | if (!ASSERT_NONNULL(view)) { |
854 | return NULL; | 854 | return NULL; |
855 | } | 855 | } |
856 | do { | 856 | while (view->type != C_WORKSPACE && view->parent) { |
857 | view = view->parent; | 857 | view = view->parent; |
858 | if (view->layout == L_TABBED || view->layout == L_STACKED) { | 858 | if (view->layout == L_TABBED || view->layout == L_STACKED) { |
859 | parent = view; | 859 | parent = view; |
860 | } | 860 | } |
861 | } while (view && view->type != C_WORKSPACE); | 861 | } |
862 | 862 | ||
863 | return parent; | 863 | return parent; |
864 | } | 864 | } |