mirror of
https://github.com/netbirdio/netbird.git
synced 2025-02-23 05:31:28 +01:00
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:
parent
2d1dfa3ae7
commit
65247de48d
@ -493,7 +493,11 @@ func getAllPeersFromGroups(account *Account, groups []string, peerID string) ([]
|
|||||||
|
|
||||||
for _, p := range group.Peers {
|
for _, p := range group.Peers {
|
||||||
peer, ok := account.Peers[p]
|
peer, ok := account.Peers[p]
|
||||||
if ok && peer != nil && peer.ID == peerID {
|
if !ok || peer == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if peer.ID == peerID {
|
||||||
peerInGroups = true
|
peerInGroups = true
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user