ipc-json: Fix NULL ptr dereference if layout NULL

This commit is contained in:
James Walmsley 2022-03-07 20:47:39 +00:00
parent 9f98c38d3e
commit 4d0a11da3d

View file

@ -236,7 +236,6 @@ static void handle_new_input(struct wl_listener *listener, void *data) {
apply_input_type_config(input_device); apply_input_type_config(input_device);
sway_input_configure_libinput_device(input_device);
wl_signal_add(&device->events.destroy, &input_device->device_destroy); wl_signal_add(&device->events.destroy, &input_device->device_destroy);
input_device->device_destroy.notify = handle_device_destroy; input_device->device_destroy.notify = handle_device_destroy;
@ -267,6 +266,8 @@ static void handle_new_input(struct wl_listener *listener, void *data) {
} }
} }
sway_input_configure_libinput_device(input_device);
if (!added) { if (!added) {
sway_log(SWAY_DEBUG, sway_log(SWAY_DEBUG,
"device '%s' is not configured on any seats", "device '%s' is not configured on any seats",