core: fix crash while connecting with AddAndActivateConnection() and SSID is missing

A network with hidden SSID can appear in gnome-shell indicator applet as
<unknown> entry. Clicking it can make NM crash if there is no SSID in wireless
setting nor in AP.
This commit is contained in:
Jiří Klimeš 2011-05-18 14:53:57 +02:00
parent 7b41be489c
commit 2b12825faa

View file

@ -1465,13 +1465,12 @@ real_complete_connection (NMDevice *device,
*/
if (!nm_ap_complete_connection (ap,
connection,
is_manf_default_ssid (ssid),
ssid ? is_manf_default_ssid (ssid) : FALSE,
error))
return FALSE;
}
g_assert (ssid);
str_ssid = nm_utils_ssid_to_utf8 (ssid);
str_ssid = ssid ? nm_utils_ssid_to_utf8 (ssid) : g_strdup (_("<hidden>"));
format = g_strdup_printf ("%s %%d", str_ssid);
nm_utils_complete_generic (connection,