summaryrefslogtreecommitdiffstats
path: root/ext/hal/hal.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2007-03-01 01:48:59 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2007-03-01 01:48:59 +0000
commit16490dc0cf0799493ca99a061264d7cc270eb3f4 (patch)
treeb29a1ddc768ef659030788a1ebcbe8ddc62b4747 /ext/hal/hal.c
parent9597bb3f079b6ad90ad11136c20473fe1da40428 (diff)
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.
Diffstat (limited to 'ext/hal/hal.c')
-rw-r--r--ext/hal/hal.c6
1 files changed, 6 insertions, 0 deletions
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);