From e7d60fab9d28595c8c21e04a2eef8a0fa1fd3501 Mon Sep 17 00:00:00 2001 From: iProgramInCpp Date: Thu, 30 May 2024 09:29:12 +0300 Subject: [PATCH] * Fix an assertion error regarding MessageList::EditMessage --- src/windows/MessageList.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/windows/MessageList.cpp b/src/windows/MessageList.cpp index 65de630..63fcfd0 100644 --- a/src/windows/MessageList.cpp +++ b/src/windows/MessageList.cpp @@ -4087,7 +4087,7 @@ void MessageList::EditMessage(const Message& newMsg) bool canInsert = false; bool firstTime = true; auto insertIter = m_messages.end(); - for (; firstTime || insertIter != m_messages.end(); ++insertIter) + while (firstTime || insertIter != m_messages.end()) { Snowflake thisSF = 0, nextSF = UINT64_MAX; @@ -4115,6 +4115,8 @@ void MessageList::EditMessage(const Message& newMsg) if (firstTime) insertIter = m_messages.begin(); + else + ++insertIter; firstTime = false; }