diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-07-02 18:18:14 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-07-02 18:18:14 +0200 |
commit | d75b24e3d86e48585af62954e569b806ef1fa552 (patch) | |
tree | 027a2594e59f8069872844f0f36bbb3a955ca83c | |
parent | 45d9745fd9c093875e67e92cd69543adfc707644 (diff) | |
download | libquotient-d75b24e3d86e48585af62954e569b806ef1fa552.tar.gz libquotient-d75b24e3d86e48585af62954e569b806ef1fa552.zip |
Room::memberJoinState(): return Leave if user == nullptr
-rw-r--r-- | lib/room.cpp | 5 |
1 files 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; } |