diff options
author | Anatoly Serdtcev <serdtcev@maps.me> | 2018-12-27 15:29:02 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2018-12-27 17:13:03 +0300 |
commit | 86d7c1f50ad441fb9df94f8a7cd8ac69afa40689 (patch) | |
tree | 363a23260b428c68cc47dc659992538c69580cc3 /geocoder | |
parent | 3a6e1f02bf70abc4eb57b7020a1d9eca64c98e58 (diff) |
[geocoder] Fix for review
Diffstat (limited to 'geocoder')
-rw-r--r-- | geocoder/hierarchy.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/geocoder/hierarchy.cpp b/geocoder/hierarchy.cpp index bff5558aa0..43e334b0bf 100644 --- a/geocoder/hierarchy.cpp +++ b/geocoder/hierarchy.cpp @@ -68,20 +68,24 @@ bool Hierarchy::Entry::DeserializeFromJSONImpl(json_t * const root, string const MYTHROW(base::Json::Exception, ("Not a json object.")); } - json_t * const properties = base::GetJSONObligatoryField(root, "properties"); - json_t * const address = base::GetJSONObligatoryField(properties, "address"); + json_t * properties = nullptr; + FromJSONObject(root, "properties", properties); + json_t * address = nullptr; + FromJSONObject(properties, "address", address); + bool hasDuplicateAddress = false; for (size_t i = 0; i < static_cast<size_t>(Type::Count); ++i) { Type const type = static_cast<Type>(i); string const & levelKey = ToString(type); - auto * levelJson = base::GetJSONOptionalField(address, levelKey); + json_t * levelJson = nullptr; + FromJSONObjectOptionalField(address, levelKey, levelJson); if (!levelJson) continue; - if (json_is_null(levelJson)) - return false; + if (base::JSONIsNull(levelJson)) + return false; string levelValue; FromJSON(levelJson, levelValue); |