From d75b24e3d86e48585af62954e569b806ef1fa552 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Fri, 2 Jul 2021 18:18:14 +0200 Subject: Room::memberJoinState(): return Leave if user == nullptr --- lib/room.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/room.cpp b/lib/room.cpp index 7b60a77d..85eadd67 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -618,8 +618,9 @@ User* Room::user(const QString& userId) const JoinState Room::memberJoinState(User* user) const { - return d->membersMap.contains(user->name(this), user) ? JoinState::Join - : JoinState::Leave; + return user != nullptr && d->membersMap.contains(user->name(this), user) + ? JoinState::Join + : JoinState::Leave; } JoinState Room::joinState() const { return d->joinState; } -- cgit v1.2.3