diff --git a/src/libneochat/neochatroom.cpp b/src/libneochat/neochatroom.cpp index d23878b4d..cf53e96ff 100644 --- a/src/libneochat/neochatroom.cpp +++ b/src/libneochat/neochatroom.cpp @@ -1252,10 +1252,8 @@ void NeoChatRoom::reportEvent(const QString &eventId, const QString &reason) QByteArray NeoChatRoom::getEventJsonSource(const QString &eventId) { - auto evtIt = findInTimeline(eventId); - if (evtIt != messageEvents().rend() && is(**evtIt)) { - const auto event = evtIt->viewAs(); - return QJsonDocument(event->fullJson()).toJson(); + if (const auto evtIt = findInTimeline(eventId); evtIt != messageEvents().rend() && is(**evtIt)) { + return QJsonDocument(evtIt->viewAs()->fullJson()).toJson(); } return {}; }