media-session: handle key == NULL

The key can be null when the metadata subject is removed.
This commit is contained in:
Wim Taymans 2021-01-19 17:01:24 +01:00
parent 96a2a2b4e2
commit 8f80a2bc15

View file

@ -844,7 +844,8 @@ static int metadata_property(void *object, uint32_t subject,
if (dst_node && src_node) if (dst_node && src_node)
handle_move(impl, src_node, dst_node); handle_move(impl, src_node, dst_node);
} else if (val == SPA_ID_INVALID && strcmp(key, "target.node") == 0) { } else if (val == SPA_ID_INVALID && key != NULL &&
strcmp(key, "target.node") == 0) {
/* Unset target node. Schedule rescan to re-link, if needed. */ /* Unset target node. Schedule rescan to re-link, if needed. */
struct node *src_node; struct node *src_node;
src_node = find_node_by_id(impl, subject); src_node = find_node_by_id(impl, subject);