mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 04:58:01 +02:00
nmtui connect: avoid segfault when iface is not found
https://github.com/NetworkManager/NetworkManager/pull/21
This commit is contained in:
parent
70c0f7965d
commit
1fcbb69ae2
1 changed files with 7 additions and 3 deletions
|
|
@ -621,6 +621,7 @@ nmt_connect_connection_list_get_connection (NmtConnectConnectionList *list,
|
||||||
NmtConnectDevice *nmtdev;
|
NmtConnectDevice *nmtdev;
|
||||||
NmtConnectConnection *nmtconn = NULL;
|
NmtConnectConnection *nmtconn = NULL;
|
||||||
NMConnection *conn = NULL;
|
NMConnection *conn = NULL;
|
||||||
|
const char *iface = NULL;
|
||||||
|
|
||||||
g_return_val_if_fail (identifier, FALSE);
|
g_return_val_if_fail (identifier, FALSE);
|
||||||
|
|
||||||
|
|
@ -643,9 +644,12 @@ nmt_connect_connection_list_get_connection (NmtConnectConnectionList *list,
|
||||||
goto found;
|
goto found;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!conn && nmtdev->device && !strcmp (identifier, nm_device_get_ip_iface (nmtdev->device))) {
|
if (!conn && nmtdev->device) {
|
||||||
nmtconn = nmtdev->conns->data;
|
iface = nm_device_get_ip_iface (nmtdev->device);
|
||||||
goto found;
|
if (iface && !strcmp (identifier, iface)) {
|
||||||
|
nmtconn = nmtdev->conns->data;
|
||||||
|
goto found;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue