From c5a4f537b4a11455d1924ae737a92a8f16b2fcd7 Mon Sep 17 00:00:00 2001 From: Andrea Giove Date: Tue, 29 Mar 2016 15:23:15 +0200 Subject: Fix problem with Update parsing --- src/TgTypeParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/TgTypeParser.cpp') diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index 079e073..244496e 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -347,9 +347,9 @@ string TgTypeParser::parseLocation(const Location::Ptr& object) const { Update::Ptr TgTypeParser::parseJsonAndGetUpdate(const ptree& data) const { Update::Ptr result(new Update); result->updateId = data.get("update_id"); - result->message = parseJsonAndGetMessage(data.find("message")->second); - result->inlineQuery = parseJsonAndGetInlineQuery(data.find("inline_query")->second); - result->chosenInlineResult = parseJsonAndGetChosenInlineResult(data.find("chosen_inline_result")->second); + result->message = tryParseJson(&TgTypeParser::parseJsonAndGetMessage, data, "message"); + result->inlineQuery = tryParseJson(&TgTypeParser::parseJsonAndGetInlineQuery, data, "inline_query"); + result->chosenInlineResult = tryParseJson(&TgTypeParser::parseJsonAndGetChosenInlineResult, data, "chosen_inline_result"); return result; } -- cgit v1.2.3