diff options
-rw-r--r-- | sway/ipc-json.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 9a955991..abc4a086 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -485,13 +485,13 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) { | |||
485 | json_object_object_add(json, "colors", colors); | 485 | json_object_object_add(json, "colors", colors); |
486 | 486 | ||
487 | // Add outputs if defined | 487 | // Add outputs if defined |
488 | json_object *outputs = json_object_new_array(); | ||
489 | if (bar->outputs && bar->outputs->length > 0) { | 488 | if (bar->outputs && bar->outputs->length > 0) { |
489 | json_object *outputs = json_object_new_array(); | ||
490 | for (int i = 0; i < bar->outputs->length; ++i) { | 490 | for (int i = 0; i < bar->outputs->length; ++i) { |
491 | const char *name = bar->outputs->items[i]; | 491 | const char *name = bar->outputs->items[i]; |
492 | json_object_array_add(outputs, json_object_new_string(name)); | 492 | json_object_array_add(outputs, json_object_new_string(name)); |
493 | } | 493 | } |
494 | json_object_object_add(json, "outputs", outputs); | ||
494 | } | 495 | } |
495 | json_object_object_add(json, "outputs", outputs); | ||
496 | return json; | 496 | return json; |
497 | } | 497 | } |