From 6cef0092722732896b5f9a9f793de1487b1219eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= Date: Mon, 13 Aug 2012 21:27:27 +0200 Subject: [PATCH] shell: don't segfault when pressing super+k when no surface is focused --- src/shell.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shell.c b/src/shell.c index 51480ce4..4d6bc4ff 100644 --- a/src/shell.c +++ b/src/shell.c @@ -3271,12 +3271,17 @@ static void force_kill_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data) { + struct wl_surface *focus_surface; struct wl_client *client; pid_t pid; uid_t uid; gid_t gid; - client = seat->keyboard->focus->resource.client; + focus_surface = seat->keyboard->focus; + if (!focus_surface) + return; + + client = focus_surface->resource.client; wl_client_get_credentials(client, &pid, &uid, &gid); kill(pid, SIGKILL);