aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-11-27 21:09:41 +0100
committeremersion <contact@emersion.fr>2018-11-27 21:09:41 +0100
commit658b5905671ec229e44986e82af2666c40435d43 (patch)
tree81b33cebdd6af62efe9c8c42641d0f8fcf5db0dc
parentbfa7f4ee0dd5988ea54795862a12a1eb1680b3f7 (diff)
gtk-primary-selection: fix segfault when no focus
-rw-r--r--types/wlr_gtk_primary_selection.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/types/wlr_gtk_primary_selection.c b/types/wlr_gtk_primary_selection.c
index 5a31d242..ebf4e5e3 100644
--- a/types/wlr_gtk_primary_selection.c
+++ b/types/wlr_gtk_primary_selection.c
@@ -232,6 +232,9 @@ static void device_send_selection(
struct wlr_gtk_primary_selection_device *device) {
struct wlr_seat_client *seat_client =
device->seat->keyboard_state.focused_client;
+ if (seat_client == NULL) {
+ return;
+ }
struct wl_resource *resource;
wl_resource_for_each(resource, &device->resources) {