Fix crash
This commit is contained in:
parent
919711d003
commit
c3a9f9fe2d
@ -15,6 +15,7 @@
|
||||
#include "td/telegram/VideosManager.h"
|
||||
|
||||
#include "td/utils/algorithm.h"
|
||||
#include "Document.hpp"
|
||||
|
||||
namespace td {
|
||||
|
||||
@ -36,6 +37,7 @@ void Document::append_file_ids(const Td *td, vector<FileId> &file_ids) const {
|
||||
|
||||
file_ids.push_back(file_id);
|
||||
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
FileId thumbnail_file_id = [&] {
|
||||
switch (type) {
|
||||
case Type::Animation:
|
||||
@ -55,6 +57,7 @@ void Document::append_file_ids(const Td *td, vector<FileId> &file_ids) const {
|
||||
if (thumbnail_file_id.is_valid()) {
|
||||
file_ids.push_back(thumbnail_file_id);
|
||||
}
|
||||
}
|
||||
|
||||
FileId animated_thumbnail_file_id = [&] {
|
||||
switch (type) {
|
||||
|
@ -4943,6 +4943,7 @@ void update_message_content_file_id_remote(MessageContent *content, FileId file_
|
||||
}
|
||||
|
||||
FileId get_message_content_thumbnail_file_id(const MessageContent *content, const Td *td) {
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
switch (content->get_type()) {
|
||||
case MessageContentType::Animation:
|
||||
return td->animations_manager_->get_animation_thumbnail_file_id(
|
||||
@ -4972,6 +4973,7 @@ FileId get_message_content_thumbnail_file_id(const MessageContent *content, cons
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FileId();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user