aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/StoryContent.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2023-05-25 21:25:16 +0300
committerlevlam <levlam@telegram.org>2023-05-25 21:25:16 +0300
commit936c27577e0b6a39dfe826801c268bdc2ada3b57 (patch)
tree58eb9adc40b74b4d98cb177be4390abe27f82e07 /td/telegram/StoryContent.cpp
parent2684df5f0156613d1a84ee3417a192ccbc504fd7 (diff)
Check that input content is non-empty inside corresponding functions.
Diffstat (limited to 'td/telegram/StoryContent.cpp')
-rw-r--r--td/telegram/StoryContent.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/td/telegram/StoryContent.cpp b/td/telegram/StoryContent.cpp
index c7331bd1e..3501e2e5d 100644
--- a/td/telegram/StoryContent.cpp
+++ b/td/telegram/StoryContent.cpp
@@ -136,6 +136,9 @@ unique_ptr<StoryContent> get_story_content(Td *td, tl_object_ptr<telegram_api::M
Result<unique_ptr<StoryContent>> get_input_story_content(
Td *td, td_api::object_ptr<td_api::InputStoryContent> &&input_story_content, DialogId owner_dialog_id) {
LOG(INFO) << "Get input story content from " << to_string(input_story_content);
+ if (input_story_content == nullptr) {
+ return Status::Error(400, "Input story content must be non-empty");
+ }
switch (input_story_content->get_id()) {
case td_api::inputStoryContentPhoto::ID: {