diff options
author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-15 08:37:56 -0400 |
---|---|---|
committer | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-15 08:37:56 -0400 |
commit | b60e8b14c592024904a149a442d32f7bbf0f6b96 (patch) | |
tree | 6942e737eec325c51720a0e3960564bdf600e09e /pkg | |
parent | c6cedf090ff57650fe7e7510ed2f93f93fdff23d (diff) | |
download | Atlas-b60e8b14c592024904a149a442d32f7bbf0f6b96.tar.gz Atlas-b60e8b14c592024904a149a442d32f7bbf0f6b96.zip |
pkg/api/api0: Add nil check to ServerList.freeServer
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/api/api0/serverlist.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/api/api0/serverlist.go b/pkg/api/api0/serverlist.go index 3248465..b36ac3f 100644 --- a/pkg/api/api0/serverlist.go +++ b/pkg/api/api0/serverlist.go @@ -672,6 +672,9 @@ func (s *ServerList) freeServer(x *Server) { // we need to ensure that we only delete a server from the indexes if the // index is pointing to our specific server since a new server with the same // address could have replaced it + if x == nil { + return + } if s.servers1 != nil { if esrv, exists := s.servers1[x.Addr]; exists && esrv == x { delete(s.servers1, x.Addr) |