Network: avoid a possible crash
When there are no active connections, nm_device_get_active_connections returns NULL.
This commit is contained in:
parent
f9a186a272
commit
e5675435c2
1 changed files with 3 additions and 0 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Reference in a new issue