mirror of
https://github.com/status-im/consul.git
synced 2025-02-16 23:57:07 +00:00
Adds explicit check for empty node in source parameter.
This commit is contained in:
parent
78b2c2d7ac
commit
6d845c7d0d
@ -122,6 +122,11 @@ func (s *Server) sortNodesByDistanceFrom(source structs.QuerySource, subj interf
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We can't sort if there's no source node.
|
||||||
|
if source.Node == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// We can't compare coordinates across DCs.
|
// We can't compare coordinates across DCs.
|
||||||
if source.Datacenter != s.config.Datacenter {
|
if source.Datacenter != s.config.Datacenter {
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user