diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index c2ed653d0..96c9ad2b0 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -1671,7 +1671,11 @@ void NeoChatRoom::cleanupExtraEvent(const QString &eventId) } QString NeoChatRoom::invitingUserId() const { - return currentState().get(connection()->userId())->senderId(); + auto event = currentState().get(connection()->userId()); + if (!event) { + return {}; + } + return event->senderId(); } void NeoChatRoom::setRoomState(const QString &type, const QString &stateKey, const QByteArray &content)