mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-09 23:27:58 +02:00
Don't create index if peer is empty (#435)
When checking for existing prefix routes Return nil if peer is empty
This commit is contained in:
@ -79,6 +79,11 @@ func (am *DefaultAccountManager) GetRoute(accountID, routeID string) (*route.Rou
|
||||
|
||||
// checkPrefixPeerExists checks the combination of prefix and peer id, if it exists returns an error, otherwise returns nil
|
||||
func (am *DefaultAccountManager) checkPrefixPeerExists(accountID, peer string, prefix netip.Prefix) error {
|
||||
|
||||
if peer == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
routesWithPrefix, err := am.Store.GetRoutesByPrefix(accountID, prefix)
|
||||
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user