if (closure == NULL && errno == ENOMEM) {
wl_resource_post_no_memory(resource);
break;
+ } else if (closure == NULL) {
+ wl_resource_post_error(client->display_resource,
+ WL_DISPLAY_ERROR_INVALID_METHOD,
+ "invalid arguments for %s@%u.%s",
+ object->interface->name,
+ object->id,
+ message->name);
+ break;
} else {
pthread_mutex_lock(&client->objects_mutex);
int lookup_ret = wl_closure_lookup_objects(closure, &client->objects);
pthread_mutex_unlock(&client->objects_mutex);
- if (closure == NULL || lookup_ret < 0) {
+ if (lookup_ret < 0) {
wl_resource_post_error(client->display_resource,
WL_DISPLAY_ERROR_INVALID_METHOD,
"invalid arguments for %s@%u.%s",