diff options
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r-- | sway/ipc-server.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index de72beca..ba0cb310 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -414,7 +414,11 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
414 | struct libinput_device *device = input_devices->items[i]; | 414 | struct libinput_device *device = input_devices->items[i]; |
415 | char* identifier = libinput_dev_unique_id(device); | 415 | char* identifier = libinput_dev_unique_id(device); |
416 | json_object *device_object = json_object_new_object(); | 416 | json_object *device_object = json_object_new_object(); |
417 | json_object_object_add(device_object, "identifier", json_object_new_string(identifier)); | 417 | if (!identifier) { |
418 | json_object_object_add(device_object, "identifier", NULL); | ||
419 | } else { | ||
420 | json_object_object_add(device_object, "identifier", json_object_new_string(identifier)); | ||
421 | } | ||
418 | json_object_array_add(inputs, device_object); | 422 | json_object_array_add(inputs, device_object); |
419 | free(identifier); | 423 | free(identifier); |
420 | } | 424 | } |