mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2024-12-04 13:43:19 +01:00
81-separate-synchronisation-into-independent-process
- nil dereference when no joins
This commit is contained in:
parent
1f8d229076
commit
5efff2314b
@ -238,6 +238,10 @@ func (m *WgMeshConfigApplyer) getClientConfig(params *GetConfigParams) (*wgtypes
|
||||
})
|
||||
})
|
||||
|
||||
routesForMesh = lib.Filter(routesForMesh, func (rns []routeNode) {
|
||||
return len(rns) != 0
|
||||
})
|
||||
|
||||
routes := lib.Map(routesForMesh, func(rs []routeNode) net.IPNet {
|
||||
return *rs[0].route.GetDestination()
|
||||
})
|
||||
@ -452,7 +456,7 @@ func (m *WgMeshConfigApplyer) getAllRoutes() (map[string][]routeNode, error) {
|
||||
allRoutes := make(map[string][]routeNode)
|
||||
|
||||
for _, mesh := range m.meshManager.GetMeshes() {
|
||||
routes, err := m.getRoutes(mesh)
|
||||
routes, err := m.getRoutes(mesh)2
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user