[gnome-control-center] Network: avoid a possible crash



commit e5675435c2ed98476555c5a89714c2ec68f4abf3
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed May 25 07:05:44 2011 -0400

    Network: avoid a possible crash
    
    When there are no active connections, nm_device_get_active_connections
    returns NULL.

 panels/network/cc-network-panel.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 644e61d..15c2950 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -1028,6 +1028,9 @@ find_connection_for_device (CcNetworkPanel *panel,
         gint i;
 
         connections = nm_client_get_active_connections (panel->priv->client);
+        if (connections == NULL) {
+                return NULL;
+        }
 
         for (i = 0; i < connections->len; i++) {
                 c = (NMActiveConnection *)connections->pdata[i];



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