From fc41af5c98d5f244deebd9cc6776adcbacaafb9b Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Wed, 19 May 2021 18:26:17 -0400 Subject: [PATCH] m-mixer-api: make sure the enum param iterator is valid Some audio nodes such as null-audio-sink nodes don't support Props or Route enum params. --- modules/module-mixer-api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/module-mixer-api.c b/modules/module-mixer-api.c index 67411d72..04ad710d 100644 --- a/modules/module-mixer-api.c +++ b/modules/module-mixer-api.c @@ -191,7 +191,7 @@ collect_node_info (WpMixerApi * self, struct node_info *info, g_auto (GValue) val = G_VALUE_INIT; it = wp_pipewire_object_enum_params_sync (dev, "Route", NULL); - for (; wp_iterator_next (it, &val); g_value_unset (&val)) { + for (; it && wp_iterator_next (it, &val); g_value_unset (&val)) { WpSpaPod *param = g_value_get_boxed (&val); gint32 r_index = -1, r_device = -1; g_autoptr (WpSpaPod) props = NULL; @@ -220,7 +220,7 @@ collect_node_info (WpMixerApi * self, struct node_info *info, g_auto (GValue) val = G_VALUE_INIT; it = wp_pipewire_object_enum_params_sync (node, "Props", NULL); - for (; wp_iterator_next (it, &val); g_value_unset (&val)) { + for (; it && wp_iterator_next (it, &val); g_value_unset (&val)) { WpSpaPod *param = g_value_get_boxed (&val); if (node_info_fill (info, param)) break;