From 19a83123e908e8d80b404d47ec843fa6f0d4a5a6 Mon Sep 17 00:00:00 2001 From: kukin-konstantin Date: Thu, 12 Jan 2017 18:01:49 +0300 Subject: fix parse Array error --- src/TgTypeParser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/TgTypeParser.cpp') diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index 0952d75..f22a868 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -467,7 +467,8 @@ std::string TgTypeParser::parseReplyKeyboardMarkup(const ReplyKeyboardMarkup::Pt result.erase(result.length() - 1); result += "],"; } - result.erase(result.length() - 1); + if (!object->keyboard.empty()) + result.erase(result.length() - 1); result += "],"; appendToJson(result, "resize_keyboard", object->resizeKeyboard); appendToJson(result, "one_time_keyboard", object->oneTimeKeyboard); @@ -1329,7 +1330,8 @@ std::string TgTypeParser::parseInlineKeyboardMarkup(const InlineKeyboardMarkup:: result.erase(result.length() - 1); result += "],"; } - result.erase(result.length() - 1); + if (!object->inlineKeyboard.empty()) + result.erase(result.length() - 1); result += "]}"; return result; } -- cgit v1.2.3