Fix update_message.

GitOrigin-RevId: a3b2cce00a5188328cc577896eceb8bfe130b5f8
This commit is contained in:
levlam 2018-04-02 23:32:49 +03:00
parent ac8b30f6e6
commit 1902a5f0e6

View File

@ -22395,8 +22395,9 @@ void MessagesManager::update_message(Dialog *d, unique_ptr<Message> &old_message
}
if (old_message->reply_to_message_id != new_message->reply_to_message_id) {
if (new_message->reply_to_message_id == MessageId() &&
get_message_force(d, old_message->reply_to_message_id) == nullptr) {
// Can't check "&& get_message_force(d, old_message->reply_to_message_id) == nullptr", because it
// can change message tree and invalidate reference to old_message
if (new_message->reply_to_message_id == MessageId()) {
old_message->reply_to_message_id = MessageId();
is_changed = true;
} else {