Network: avoid a possible crash

When there are no active connections, nm_device_get_active_connections
returns NULL.
This commit is contained in:
Matthias Clasen 2011-05-25 07:05:44 -04:00
parent f9a186a272
commit e5675435c2

View file

@ -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];