[gnome-bluetooth] lib: Slightly better sanity check



commit f4a10519e15e54583234f6ed5fbf2dbe7e63298d
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Sep 27 15:36:14 2011 +0100

    lib: Slightly better sanity check
    
    It should be impossible to have a paired device without
    a device node, but you never know.

 lib/bluetooth-client.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 68ebfed..c7daa83 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -1516,7 +1516,8 @@ gboolean bluetooth_client_create_device (BluetoothClient *client,
 		gtk_tree_model_get (GTK_TREE_MODEL(priv->store), &iter,
 				    BLUETOOTH_COLUMN_PROXY, &device,
 				    BLUETOOTH_COLUMN_PAIRED, &paired, -1);
-		if (paired != FALSE &&
+		if (device != NULL &&
+		    paired != FALSE &&
 		    dbus_g_proxy_call (adapter, "RemoveDevice", &err,
 				       DBUS_TYPE_G_OBJECT_PATH, dbus_g_proxy_get_path (device),
 				       G_TYPE_INVALID, G_TYPE_INVALID) == FALSE) {



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