Prevent NULL dereference in tablet_tool handler

In case a tool was removed, but not yet destroyed by the client, the
tool_client's tool can be NULL. We have to check that as well in the
set_cursor handler to prevent using inert resources
This commit is contained in:
Markus Ongyerth 2019-02-15 21:01:52 +01:00 committed by emersion
parent b455df3b91
commit fc9838b15e
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ static void handle_tablet_tool_v2_set_cursor(struct wl_client *client,
struct wl_resource *surface_resource,
int32_t hotspot_x, int32_t hotspot_y) {
struct wlr_tablet_tool_client_v2 *tool = tablet_tool_client_from_resource(resource);
if (!tool) {
if (!tool || !tool->tool) {
return;
}