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 df9a7292b9)
Co-authored-by: Aleix Pol <aleixpol@kde.org>
This commit is contained in:
@@ -1671,7 +1671,11 @@ void NeoChatRoom::cleanupExtraEvent(const QString &eventId)
|
||||
}
|
||||
QString NeoChatRoom::invitingUserId() const
|
||||
{
|
||||
return currentState().get<RoomMemberEvent>(connection()->userId())->senderId();
|
||||
auto event = currentState().get<RoomMemberEvent>(connection()->userId());
|
||||
if (!event) {
|
||||
return {};
|
||||
}
|
||||
return event->senderId();
|
||||
}
|
||||
|
||||
void NeoChatRoom::setRoomState(const QString &type, const QString &stateKey, const QByteArray &content)
|
||||
|
||||
Reference in New Issue
Block a user