iwd: don't call nm_wifi_ap_set_ssid for empty SSID

If SSID is an empty string there's no need to call nm_wifi_ap_set_ssid
as it won't do anything.  It also has an assert checking that NULL is
passed for an empty SSID and we were passing a non-NULL pointer.
This commit is contained in:
Andrew Zaborowski 2018-03-05 00:38:36 +01:00 committed by Andrew Zaborowski
parent 8435aa8b31
commit 29e9d206aa

View file

@ -334,7 +334,8 @@ get_ordered_networks_cb (GObject *source, GAsyncResult *res, gpointer user_data)
props = g_variant_new ("a{sv}", &builder);
ap = nm_wifi_ap_new_from_properties (path, props);
nm_wifi_ap_set_ssid (ap, (const guint8 *) name, strlen (name));
if (name[0] != '\0')
nm_wifi_ap_set_ssid (ap, (const guint8 *) name, strlen (name));
nm_wifi_ap_set_strength (ap, nm_wifi_utils_level_to_quality (signal / 100));
nm_wifi_ap_set_freq (ap, 2417);
nm_wifi_ap_set_max_bitrate (ap, 65000);