Don't crash while trying to load last message by own user

Fixes #535
This commit is contained in:
Tobias Fella
2022-05-17 13:50:54 +02:00
parent 35f30c293b
commit 0d00d4200c

View File

@@ -815,6 +815,9 @@ QVariant MessageEventModel::getLastLocalUserMessageEventId()
for (auto it = timelineBottom; it != limit; ++it) {
auto evt = it->event();
auto e = eventCast<const RoomMessageEvent>(evt);
if (!e) {
return {};
}
// check if the current message's sender's id is same as the user's id
if ((*it)->senderId() == m_currentRoom->localUser()->id()) {