mirror of https://github.com/status-im/consul.git
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
|
||||
}
|
||||
|
||||
// We can't sort if there's no source node.
|
||||
if source.Node == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
// We can't compare coordinates across DCs.
|
||||
if source.Datacenter != s.config.Datacenter {
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue