input: Don't try to send axis_source when there are no resources

The focus_client pointer may be NULL here if the focused client has no
pointer resources. To avoid a crash, NULL check focus client before
proceeding to send the events.

https://bugs.freedesktop.org/show_bug.cgi?id=94899

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
This commit is contained in:
Jonas Ådahl 2016-04-21 10:21:48 +08:00
parent 8b6c9fcd4e
commit ed6014a9e4

View file

@ -367,6 +367,9 @@ weston_pointer_send_axis_source(struct weston_pointer *pointer, uint32_t source)
struct wl_resource *resource;
struct wl_list *resource_list;
if (!pointer->focus_client)
return;
resource_list = &pointer->focus_client->pointer_resources;
wl_resource_for_each(resource, resource_list) {
if (wl_resource_get_version(resource) >=