Fix crash
This commit is contained in:
parent
919711d003
commit
c3a9f9fe2d
@ -15,6 +15,7 @@
|
|||||||
#include "td/telegram/VideosManager.h"
|
#include "td/telegram/VideosManager.h"
|
||||||
|
|
||||||
#include "td/utils/algorithm.h"
|
#include "td/utils/algorithm.h"
|
||||||
|
#include "Document.hpp"
|
||||||
|
|
||||||
namespace td {
|
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);
|
file_ids.push_back(file_id);
|
||||||
|
|
||||||
|
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||||
FileId thumbnail_file_id = [&] {
|
FileId thumbnail_file_id = [&] {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Type::Animation:
|
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()) {
|
if (thumbnail_file_id.is_valid()) {
|
||||||
file_ids.push_back(thumbnail_file_id);
|
file_ids.push_back(thumbnail_file_id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FileId animated_thumbnail_file_id = [&] {
|
FileId animated_thumbnail_file_id = [&] {
|
||||||
switch (type) {
|
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) {
|
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()) {
|
switch (content->get_type()) {
|
||||||
case MessageContentType::Animation:
|
case MessageContentType::Animation:
|
||||||
return td->animations_manager_->get_animation_thumbnail_file_id(
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return FileId();
|
return FileId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user