supplicant: fix crash when connecting without both 'password' and 'password-raw'

It is the case e.g. for EAP-TLS. This regression was caused by commit
b08e2b8932.
This commit is contained in:
Jiří Klimeš
2012-01-30 18:29:13 +01:00
parent 2c52303f59
commit b127fda19f

View File

@@ -734,6 +734,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
return FALSE; return FALSE;
} else { } else {
array = nm_setting_802_1x_get_password_raw (setting); array = nm_setting_802_1x_get_password_raw (setting);
if (array) {
success = nm_supplicant_config_add_option (self, success = nm_supplicant_config_add_option (self,
"password", "password",
(const char *)array->data, (const char *)array->data,
@@ -744,6 +745,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
return FALSE; return FALSE;
} }
} }
}
value = nm_setting_802_1x_get_pin (setting); value = nm_setting_802_1x_get_pin (setting);
if (!add_string_val (self, value, "pin", FALSE, TRUE)) if (!add_string_val (self, value, "pin", FALSE, TRUE))
return FALSE; return FALSE;