Fix: ignore nil contact 'IsDisplayNameDupeOfCommunityMember' (#4956)

This commit is contained in:
Mikhail Rogachev 2024-03-21 20:43:51 +01:00 committed by GitHub
parent 0aed93ff04
commit c7e7445f5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -614,6 +614,9 @@ func (m *Messenger) IsDisplayNameDupeOfCommunityMember(name string) (bool, error
for _, community := range append(controlled, joined...) {
for memberKey := range community.Members() {
contact := m.GetContactByID(memberKey)
if contact == nil {
continue
}
if strings.Compare(contact.DisplayName, name) == 0 {
return true, nil
}