From 16490dc0cf0799493ca99a061264d7cc270eb3f4 Mon Sep 17 00:00:00 2001 From: Sebastian Dröge Date: Thu, 1 Mar 2007 01:48:59 +0000 Subject: ext/hal/: Check if the device UDI is set before trying to query HAL about it and give a useful error message if it wa... Original commit message from CVS: * ext/hal/gsthalaudiosink.c: (do_toggle_element): * ext/hal/gsthalaudiosrc.c: (do_toggle_element): Check if the device UDI is set before trying to query HAL about it and give a useful error message if it wasn't set. * ext/hal/hal.c: (gst_hal_get_string): Don't query HAL for NULL UDIs. Passing NULL as UDI to HAL gives an assertion failure in D-Bus when running with DBUS_FATAL_WARNINGS=1. --- ext/hal/hal.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ext/hal/hal.c') diff --git a/ext/hal/hal.c b/ext/hal/hal.c index 519258d6..57da8425 100644 --- a/ext/hal/hal.c +++ b/ext/hal/hal.c @@ -50,6 +50,12 @@ gst_hal_get_string (const gchar * udi) LibHalContext *ctx; char *string; + /* Don't query HAL for NULL UDIs. Passing NULL as UDI to HAL gives + * an assertion failure in D-Bus when running with + * DBUS_FATAL_WARNINGS=1. */ + if (!udi) + return NULL; + dbus_error_init (&error); connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error); -- cgit