Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: chromeos/network/onc/onc_translator_shill_to_onc.cc

Issue 2856313002: ONC: Do not display errors when parsing empty EAP.EAP fields (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_translator_shill_to_onc.cc
diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc
index e709c75015843cb05fbd1eab3f44717a6594de23..297822b6b676b5de4bc71d465d6f8aba08ac8996 100644
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -636,11 +636,16 @@ void ShillToONCTranslator::TranslateStaticIPConfig() {
void ShillToONCTranslator::TranslateEap() {
CopyPropertiesAccordingToSignature();
- // Translate EAP Outer and Inner values.
- TranslateWithTableAndSet(shill::kEapMethodProperty, kEAPOuterTable,
- ::onc::eap::kOuter);
- TranslateWithTableAndSet(shill::kEapPhase2AuthProperty, kEAP_TTLS_InnerTable,
- ::onc::eap::kInner);
+ // Translate EAP Outer and Inner values if EAP.EAP exists and is not empty.
+ std::string shill_eap;
+ if (shill_dictionary_->GetStringWithoutPathExpansion(
+ shill::kEapMethodProperty, &shill_eap) &&
+ !shill_eap.empty()) {
+ TranslateWithTableAndSet(shill::kEapMethodProperty, kEAPOuterTable,
+ ::onc::eap::kOuter);
+ TranslateWithTableAndSet(shill::kEapPhase2AuthProperty,
+ kEAP_TTLS_InnerTable, ::onc::eap::kInner);
+ }
}
void ShillToONCTranslator::TranslateAndAddNestedObject(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698