Commit 4081b158 authored by stevenjb's avatar stevenjb Committed by Commit bot

Fix ONC logic error

A bug in onc_translator_onc_to_shill.cc is triggering a DCHECK when
a property is set in a previously non-existent dictionary.

This is a trivial fix to code that is subtle but clearly incorrect
by inspection.

BUG=none

Review URL: https://codereview.chromium.org/838043003

Cr-Commit-Position: refs/heads/master@{#311357}
parent f1eb9ccb
......@@ -353,9 +353,10 @@ void TranslateONCHierarchy(const OncValueSignature& signature,
base::DictionaryValue* nested_shill_dict = NULL;
target_shill_dictionary->GetDictionaryWithoutPathExpansion(
*it, &nested_shill_dict);
if (!nested_shill_dict)
if (!nested_shill_dict) {
nested_shill_dict = new base::DictionaryValue;
target_shill_dictionary->SetWithoutPathExpansion(*it, nested_shill_dict);
target_shill_dictionary->SetWithoutPathExpansion(*it, nested_shill_dict);
}
target_shill_dictionary = nested_shill_dict;
}
// Translates fields of |onc_object| and writes them to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment