From d986f0237c934cd4b35802c941f76f86a735ddd0 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 7 Apr 2023 16:11:19 +0300 Subject: [PATCH] Return error if no chat types are allowed. --- td/telegram/ReplyMarkup.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/td/telegram/ReplyMarkup.cpp b/td/telegram/ReplyMarkup.cpp index de220d0a5..c5d186e0c 100644 --- a/td/telegram/ReplyMarkup.cpp +++ b/td/telegram/ReplyMarkup.cpp @@ -618,6 +618,9 @@ static Result get_inline_keyboard_button(tl_object_ptrallow_channel_chats_) { current_button.id |= InlineKeyboardButton::BROADCASTS_MASK; } + if (current_button.id == 0) { + return Status::Error(400, "At least one chat type must be allowed"); + } if (current_button.id == InlineKeyboardButton::FULL_MASK) { current_button.id = 0; }