summaryrefslogtreecommitdiff
path: root/lib/wireplumber
diff options
context:
space:
mode:
authorkotontrion <[email protected]>2024-09-18 11:50:29 +0200
committerkotontrion <[email protected]>2024-09-18 11:50:29 +0200
commit18c0a31fa41f925e3324042bea940155ae6bf774 (patch)
tree2bcf8e91a93ada0346c9e31313a26938e6344ef0 /lib/wireplumber
parent71ee1ea4bf4edd790edb7067f8fb0ae6c450ce5e (diff)
device id null check
Diffstat (limited to 'lib/wireplumber')
-rw-r--r--lib/wireplumber/src/endpoint.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/wireplumber/src/endpoint.c b/lib/wireplumber/src/endpoint.c
index 8d5411d..9ae62e2 100644
--- a/lib/wireplumber/src/endpoint.c
+++ b/lib/wireplumber/src/endpoint.c
@@ -345,6 +345,7 @@ static void astal_wp_endpoint_set_property(GObject *object, guint property_id, c
}
static void astal_wp_endpoint_update_properties(AstalWpEndpoint *self) {
+
AstalWpEndpointPrivate *priv = astal_wp_endpoint_get_instance_private(self);
if (priv->node == NULL) return;
self->id = wp_proxy_get_bound_id(WP_PROXY(priv->node));
@@ -379,9 +380,11 @@ static void astal_wp_endpoint_update_properties(AstalWpEndpoint *self) {
case ASTAL_WP_MEDIA_CLASS_AUDIO_MICROPHONE:
const gchar *dev =
wp_pipewire_object_get_property(WP_PIPEWIRE_OBJECT(priv->node), "device.id");
- guint device_id = g_ascii_strtoull(dev, NULL, 10);
- AstalWpDevice *device = astal_wp_wp_get_device(priv->wp, device_id);
- icon = astal_wp_device_get_icon(device);
+ if (dev != NULL) {
+ guint device_id = g_ascii_strtoull(dev, NULL, 10);
+ AstalWpDevice *device = astal_wp_wp_get_device(priv->wp, device_id);
+ icon = astal_wp_device_get_icon(device);
+ }
if (icon == NULL) {
icon = self->type == ASTAL_WP_MEDIA_CLASS_AUDIO_SPEAKER
? "audio-card-symbolic"