aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/data_device/wlr_data_device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c
index 428f7906..808aeeb8 100644
--- a/types/data_device/wlr_data_device.c
+++ b/types/data_device/wlr_data_device.c
@@ -239,6 +239,10 @@ static void data_device_manager_get_data_device(struct wl_client *client,
}
wl_resource_set_implementation(resource, &data_device_impl, seat_client,
data_device_handle_resource_destroy);
+ if (seat_client == NULL) {
+ wl_list_init(wl_resource_get_link(resource));
+ return;
+ }
wl_list_insert(&seat_client->data_devices, wl_resource_get_link(resource));
struct wlr_seat_client *focused_client =