Exit ipc_get_workspace_callback early

This commit is contained in:
Drew DeVault 2018-03-29 22:16:43 -04:00
parent 8efee109ad
commit ddc09940b1

View file

@ -379,7 +379,9 @@ void ipc_client_disconnect(struct ipc_client *client) {
}
static void ipc_get_workspaces_callback(swayc_t *workspace, void *data) {
if (workspace->type == C_WORKSPACE) {
if (workspace->type != C_WORKSPACE) {
return;
}
json_object *workspace_json = ipc_json_describe_container(workspace);
// override the default focused indicator because
// it's set differently for the get_workspaces reply
@ -395,7 +397,6 @@ static void ipc_get_workspaces_callback(swayc_t *workspace, void *data) {
json_object_new_boolean(focused));
json_object_array_add((json_object *)data, workspace_json);
}
}
void ipc_client_handle_command(struct ipc_client *client) {
if (!sway_assert(client != NULL, "client != NULL")) {