client-node: guard against NULL resource

When destroying, the resource can be NULL (mix->io should also be
NULL ideally so we can check first).

See #2847
This commit is contained in:
Wim Taymans 2022-11-21 20:19:29 +01:00
parent 67e77d13f6
commit 9d8edef1a0

View file

@ -1493,7 +1493,7 @@ static int impl_mix_port_set_io(void *object,
else
mix->io = NULL;
if (this->resource->version >= 4 && mix->io != NULL)
if (mix->io != NULL && this->resource && this->resource->version >= 4)
pw_client_node_resource_port_set_mix_info(this->resource,
direction, port->port_id,
mix->port.port_id, mix->peer_id, NULL);