mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-27 14:59:09 +01:00
[management] Compensate for a possible nil peer when returning "empty" network map (#8285)
* we somehow can get a nil peer when returning empty components; this fix compensates for the issue, but doesn't fix the root cause (which is unknown atm) Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * fix test Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> --------- Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
This commit is contained in:
@@ -933,7 +933,7 @@ func (c *Controller) GetValidatedPeerWithComponents(ctx context.Context, isRequi
|
||||
}
|
||||
|
||||
// it's possible that the peer gets deleted between the call to "sendInitialSync()" and here, bail out in this case
|
||||
if _, ok := account.Peers[peer.ID]; !ok {
|
||||
if p, _ := account.Peers[peer.ID]; p == nil {
|
||||
return nil, nil, nil, 0, fmt.Errorf("peer '%s' no longer exists", peer.ID)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user