Fix nil pointer handling in get peers from group (#1381)

Fix nil handling in getAllPeersFromGroups to not include nil pointer in the output.
This commit is contained in:
pascal-fischer 2023-12-12 18:17:00 +01:00 committed by GitHub
parent 2d1dfa3ae7
commit 65247de48d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -493,7 +493,11 @@ func getAllPeersFromGroups(account *Account, groups []string, peerID string) ([]
for _, p := range group.Peers {
peer, ok := account.Peers[p]
if ok && peer != nil && peer.ID == peerID {
if !ok || peer == nil {
continue
}
if peer.ID == peerID {
peerInGroups = true
continue
}