wifi: fix NM crash on mode == NULL

caused by 53d8f49bcd
This commit is contained in:
Jiří Klimeš 2013-04-11 15:29:12 +02:00
parent 302e8ccab0
commit fa20c80819

View file

@ -1132,11 +1132,11 @@ check_connection_available (NMDevice *device, NMConnection *connection)
s_wifi = nm_connection_get_setting_wireless (connection);
/* Ad-Hoc connections are always available because they may be started
* at any time.
/* Ad-Hoc and AP connections are always available because they may be
* started at any time.
*/
mode = nm_setting_wireless_get_mode (s_wifi);
if (g_str_equal (mode, "adhoc") || g_str_equal (mode, "ap"))
if (g_strcmp0 (mode, "adhoc") == 0 || g_strcmp0 (mode, "ap") == 0)
return TRUE;
/* Hidden SSIDs obviously don't always appear in the scan list either */