Merge pull request #650 from neosilky/segfault

sway/container.c: fix segfault where view is assigned prematurely
This commit is contained in:
Drew DeVault 2016-05-09 10:08:56 -07:00
commit c7c2bf542a

View file

@ -820,10 +820,10 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) {
return NULL; return NULL;
} }
do { do {
view = view->parent;
if (view->layout == L_TABBED || view->layout == L_STACKED) { if (view->layout == L_TABBED || view->layout == L_STACKED) {
parent = view; parent = view;
} }
view = view->parent;
} while (view && view->type != C_WORKSPACE); } while (view && view->type != C_WORKSPACE);
return parent; return parent;