diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index ae785f92b..bab0df880 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -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