summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-01-11 11:18:14 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-01-11 11:18:14 -0500
commit62444800e1600ae6ce14525bcafac7668748c5bb (patch)
tree638414006ba4fdd4073460bc822c75c7aaac54a6
parentf0993f61c0c8b40bd037a5085587852d76702b8d (diff)
window: Don't deref focus widget if there isn't one
-rw-r--r--clients/window.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/clients/window.c b/clients/window.c
index 4d7deb2..86f084d 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -978,7 +978,8 @@ window_destroy(struct window *window)
wl_list_for_each(input, &display->input_list, link) {
if (input->pointer_focus == window)
input->pointer_focus = NULL;
- if (input->focus_widget->window == window)
+ if (input->focus_widget &&
+ input->focus_widget->window == window)
input->focus_widget = NULL;
if (input->keyboard_focus == window)
input->keyboard_focus = NULL;