mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-02 11:55:59 +01:00
Fix potential segfault
This commit is contained in:
parent
8af6fbd7a0
commit
9310d101bc
1 changed files with 7 additions and 0 deletions
|
@ -269,9 +269,16 @@ static struct wlr_data_offer *wlr_data_source_send_offer(
|
||||||
}
|
}
|
||||||
|
|
||||||
void wlr_seat_client_send_selection(struct wlr_seat_client *seat_client) {
|
void wlr_seat_client_send_selection(struct wlr_seat_client *seat_client) {
|
||||||
|
if (wl_list_empty(&seat_client->data_devices)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (seat_client->seat->selection_source) {
|
if (seat_client->seat->selection_source) {
|
||||||
struct wlr_data_offer *offer = wlr_data_source_send_offer(
|
struct wlr_data_offer *offer = wlr_data_source_send_offer(
|
||||||
seat_client->seat->selection_source, seat_client);
|
seat_client->seat->selection_source, seat_client);
|
||||||
|
if (offer == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
wl_resource_for_each(resource, &seat_client->data_devices) {
|
wl_resource_for_each(resource, &seat_client->data_devices) {
|
||||||
|
|
Loading…
Reference in a new issue