mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-25 21:58:31 +01:00
prevent workspace_find_container from crashing with NULL workspaces
This commit is contained in:
parent
74cc02d60f
commit
8f6bc5bb36
1 changed files with 5 additions and 0 deletions
|
@ -708,6 +708,11 @@ void workspace_for_each_container(struct sway_workspace *ws,
|
||||||
struct sway_container *workspace_find_container(struct sway_workspace *ws,
|
struct sway_container *workspace_find_container(struct sway_workspace *ws,
|
||||||
bool (*test)(struct sway_container *con, void *data), void *data) {
|
bool (*test)(struct sway_container *con, void *data), void *data) {
|
||||||
struct sway_container *result = NULL;
|
struct sway_container *result = NULL;
|
||||||
|
if (ws == NULL){
|
||||||
|
sway_log(SWAY_ERROR, "Cannot find container with no workspace.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Tiling
|
// Tiling
|
||||||
for (int i = 0; i < ws->tiling->length; ++i) {
|
for (int i = 0; i < ws->tiling->length; ++i) {
|
||||||
struct sway_container *child = ws->tiling->items[i];
|
struct sway_container *child = ws->tiling->items[i];
|
||||||
|
|
Loading…
Reference in a new issue