From e3550c53b92297fdaa84105c3fa9fd5b69d98e83 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 25 Mar 2011 11:12:52 +0000 Subject: defensive touches to update state method --- src/sound-service-dbus.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 1b9d29e..ea96e6a 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -237,6 +237,12 @@ sound_service_dbus_update_sound_state (SoundServiceDbus* self, GError * error = NULL; + if (priv->connection == NULL || + g_dbus_connection_is_closed (priv->connection) == TRUE){ + g_warning ("sound_service_dbus_update_sound_state - connection no good !!"); + return; + } + g_debug ("emitting state signal with value %i", (int)new_state); g_dbus_connection_emit_signal( priv->connection, NULL, -- cgit v1.2.3