From aee1132ac5149c20c02640efd143e5ef7e692245 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 6 Jul 2020 21:51:49 +0300 Subject: [PATCH] Ignore inline query games without photo. GitOrigin-RevId: fbaacdb3054d18b23806ea12cdb3f5a376761299 --- td/telegram/InlineQueriesManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/td/telegram/InlineQueriesManager.cpp b/td/telegram/InlineQueriesManager.cpp index 5aba8eadc..21db91328 100644 --- a/td/telegram/InlineQueriesManager.cpp +++ b/td/telegram/InlineQueriesManager.cpp @@ -1167,6 +1167,10 @@ void InlineQueriesManager::on_get_inline_query_results(UserId bot_user_id, uint6 bool has_photo = (flags & BOT_INLINE_MEDIA_RESULT_FLAG_HAS_PHOTO) != 0; bool is_photo = result->type_ == "photo"; if (result->type_ == "game") { + if (!has_photo) { + LOG(ERROR) << "Receive game without photo in the result of inline query: " << to_string(result); + break; + } auto game = make_tl_object(); Game inline_game(td_, std::move(result->title_), std::move(result->description_), std::move(result->photo_), std::move(result->document_), DialogId());