mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-19 19:25:41 +02:00
module/niri-workspaces: fix crash when monitor off
The niri-workspaces module would crash if niri's event stream produced a `WorkspaceChanged` event containing a workspace with no output, which can occur if the monitor is turned off. Update the response parser to handle this situation.
This commit is contained in:
parent
43e1944607
commit
4eb054792e
1 changed files with 1 additions and 1 deletions
|
@ -73,7 +73,7 @@ parser(char *response)
|
||||||
|
|
||||||
// only add workspaces on the current yambar's monitor
|
// only add workspaces on the current yambar's monitor
|
||||||
struct json_object *output = json_object_object_get(ws_obj, "output");
|
struct json_object *output = json_object_object_get(ws_obj, "output");
|
||||||
if (strcmp(instance.monitor, json_object_get_string(output)) != 0)
|
if (output == NULL || strcmp(instance.monitor, json_object_get_string(output)) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
struct niri_workspace *ws = calloc(1, sizeof(*ws));
|
struct niri_workspace *ws = calloc(1, sizeof(*ws));
|
||||||
|
|
Loading…
Add table
Reference in a new issue