diff --git a/data/taxi_places/freenow.json b/data/taxi_places/freenow.json index 1a1eeb7dda..b17fa13a05 100644 --- a/data/taxi_places/freenow.json +++ b/data/taxi_places/freenow.json @@ -60,7 +60,7 @@ "Glasgow", "London", "Manchester", - "City of Nottingham", + "Nottingham", "Oxford", "Reading" ], diff --git a/partners_api/freenow_api.cpp b/partners_api/freenow_api.cpp index 146fee74f0..34b741bba4 100644 --- a/partners_api/freenow_api.cpp +++ b/partners_api/freenow_api.cpp @@ -175,13 +175,19 @@ std::vector MakeProductsFromJson(std::string const & src) FromJSONObjectOptionalField(item, "displayName", product.m_name); auto const eta = json_object_get(item, "eta"); - uint64_t time = 0; - FromJSONObjectOptionalField(eta, "value", time); - product.m_time = strings::to_string(time); + if (json_is_object(eta)) + { + uint64_t time = 0; + FromJSONObjectOptionalField(eta, "value", time); + product.m_time = strings::to_string(time); + } auto const fare = json_object_get(item, "fare"); - FromJSONObjectOptionalField(fare, "displayValue", product.m_price); - FromJSONObjectOptionalField(fare, "currencyCode", product.m_currency); + if (json_is_object(fare)) + { + FromJSONObjectOptionalField(fare, "displayValue", product.m_price); + FromJSONObjectOptionalField(fare, "currencyCode", product.m_currency); + } if (product.m_name.empty() || product.m_time.empty() || product.m_price.empty()) continue;