From a3f5a5e56c998cdee8a4f273f3c3cdafadc9d35b Mon Sep 17 00:00:00 2001 From: llnulldisk <48621230+llnulldisk@users.noreply.github.com> Date: Tue, 18 Oct 2022 22:04:53 +0200 Subject: Fix parse error --- src/TgTypeParser.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index f6ae9f0..1f49489 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -739,8 +739,9 @@ PollAnswer::Ptr TgTypeParser::parseJsonAndGetPollAnswer(const boost::property_tr auto result(std::make_shared()); result->pollId = data.get("poll_id", ""); result->user = tryParseJson(&TgTypeParser::parseJsonAndGetUser, data, "user"); - result->optionIds = parseJsonAndGetArray([] (const boost::property_tree::ptree& innerData)->std::int32_t { - return innerData.get(0); + result->optionIds = parseJsonAndGetArray( + [] (const boost::property_tree::ptree& innerData)->std::int32_t { + return innerData.get(""); }, data, "option_ids"); return result; } @@ -3271,8 +3272,9 @@ InputInvoiceMessageContent::Ptr TgTypeParser::parseJsonAndGetInputInvoiceMessage result->currency = data.get("currency", ""); result->prices = parseJsonAndGetArray(&TgTypeParser::parseJsonAndGetLabeledPrice, data, "prices"); result->maxTipAmount = data.get("max_tip_amount", 0); - result->suggestedTipAmounts = parseJsonAndGetArray([] (const boost::property_tree::ptree& innerData)->std::int32_t { - return innerData.get(0); + result->suggestedTipAmounts = parseJsonAndGetArray( + [] (const boost::property_tree::ptree& innerData)->std::int32_t { + return innerData.get(""); }, data, "suggested_tip_amounts"); result->providerData = data.get("provider_data", ""); result->photoUrl = data.get("photo_url", ""); -- cgit v1.2.3