diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 04a757de4..8d89c1b0f 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -10104,10 +10104,12 @@ void MessagesManager::read_history_inbox(DialogId dialog_id, MessageId max_messa if (max_message_id != MessageId() && unread_count > 0 && max_message_id >= d->last_new_message_id && max_message_id >= d->last_message_id && max_message_id >= d->last_database_message_id) { - LOG(ERROR) << "Have unknown " << unread_count << " unread messages up to " << max_message_id << " in " - << dialog_id << " with last_new_message_id = " << d->last_new_message_id - << ", last_message_id = " << d->last_message_id - << ", last_database_message_id = " << d->last_database_message_id; + if (d->last_new_message_id.is_valid()) { + LOG(ERROR) << "Have unknown " << unread_count << " unread messages up to " << max_message_id << " in " + << dialog_id << " with last_new_message_id = " << d->last_new_message_id + << ", last_message_id = " << d->last_message_id + << ", last_database_message_id = " << d->last_database_message_id; + } unread_count = 0; }