Fix exception in updateChatLastMessage

This commit is contained in:
Alexander Zinchuk 2023-01-08 02:44:00 +01:00
parent 89a5647fd4
commit 969693bb18

View File

@ -779,7 +779,7 @@ function updateChatLastMessage(
}
global = updateChat(global, chatId, { lastMessage: message });
const topic = chat.isForum ? selectTopicFromMessage(global, message) : undefined;
const topic = chat?.isForum ? selectTopicFromMessage(global, message) : undefined;
if (topic) {
global = updateTopic(global, chatId, topic.id, {
lastMessageId: message.id,