Don't crash when editing pending message

This commit is contained in:
Tobias Fella
2023-09-20 16:16:40 +02:00
parent 442a343097
commit 6d7ae99c94

View File

@@ -1488,8 +1488,11 @@ QString NeoChatRoom::chatBoxEditMessage() const
EventHandler eventhandler;
eventhandler.setRoom(this);
eventhandler.setEvent(&**findInTimeline(m_chatBoxEditId));
return eventhandler.getPlainBody();
if (auto event = findInTimeline(m_chatBoxEditId); event != historyEdge()) {
eventhandler.setEvent(&**event);
return eventhandler.getPlainBody();
}
return {};
}
QString NeoChatRoom::chatBoxAttachmentPath() const