[gnome-bluetooth] lib: Fix BluetoothAgent warnings in wizard



commit 5d572650509c2afe6892a3f7c0e618507a1a4f89
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Sep 27 22:48:21 2011 +0100

    lib: Fix BluetoothAgent warnings in wizard

 lib/bluetooth-agent.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/lib/bluetooth-agent.c b/lib/bluetooth-agent.c
index 672ac5e..e65a635 100644
--- a/lib/bluetooth-agent.c
+++ b/lib/bluetooth-agent.c
@@ -371,12 +371,14 @@ gboolean bluetooth_agent_setup(BluetoothAgent *agent, const char *path)
 	priv->path = g_strdup(path);
 
 	g_free (priv->busname);
-	owner = g_dbus_proxy_get_name_owner (priv->adapter);
-	if (owner == NULL)
-		priv->busname = g_strdup (g_dbus_proxy_get_name (priv->adapter));
-	else
-		priv->busname = owner;
-	g_free (owner);
+	if (priv->adapter) {
+		owner = g_dbus_proxy_get_name_owner (priv->adapter);
+		if (owner == NULL)
+			priv->busname = g_strdup (g_dbus_proxy_get_name (priv->adapter));
+		else
+			priv->busname = owner;
+		g_free (owner);
+	}
 
 	conn = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
 	priv->id = g_dbus_connection_register_object (conn, priv->path, priv->introspection_data->interfaces[0], &interface_vtable, agent, NULL, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]