[gnome-control-center] network: Fix possible crasher when handling	argv prop
- From: Bastien Nocera <hadess src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-control-center] network: Fix possible crasher when handling	argv prop
 
- Date: Mon,  1 Oct 2012 19:17:06 +0000 (UTC)
 
commit 813843cf85bffd66af4421dcfec35487487edacf
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Oct 1 21:16:05 2012 +0200
    network: Fix possible crasher when handling argv prop
    
    When looking for a matching device, we might end up checking
    for the proxy page's nm-device, which it obviously doesn't have.
 panels/network/cc-network-panel.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index b5e4fb3..b614538 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -429,11 +429,13 @@ handle_argv (CcNetworkPanel *panel)
                 gtk_tree_model_get (model, &iter,
                                     PANEL_DEVICES_COLUMN_OBJECT, &object_tmp,
                                     -1);
-                g_object_get (object_tmp, "nm-device", &device, NULL);
-                done = handle_argv_for_device (panel, device, &iter);
+                if (g_object_class_find_property (G_OBJECT_GET_CLASS (object_tmp), "nm-device") != NULL) {
+                        g_object_get (object_tmp, "nm-device", &device, NULL);
+                        done = handle_argv_for_device (panel, device, &iter);
+                        g_object_unref (device);
+                }
 
                 g_object_unref (object_tmp);
-                g_object_unref (device);
 
                 if (done)
                         break;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]