From b75f8b527c6dc694a302ae530094b4e9c7f19065 Mon Sep 17 00:00:00 2001 From: Aleix Pol Gonzalez Date: Sun, 4 May 2025 14:46:32 +0000 Subject: [PATCH] Fixes a null pointer call It seems like the case is possible as we already are treating the case in isUserBanned. Doesn't seem ideal as it shows "" where the username should be but it's better than a crash. (cherry picked from commit df9a7292b9b93c2ec4aee620dbd87f26330e378b) Co-authored-by: Aleix Pol --- src/neochatroom.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)