aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-15 08:37:56 -0400
committerpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-15 08:37:56 -0400
commitb60e8b14c592024904a149a442d32f7bbf0f6b96 (patch)
tree6942e737eec325c51720a0e3960564bdf600e09e /pkg
parentc6cedf090ff57650fe7e7510ed2f93f93fdff23d (diff)
downloadAtlas-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.go3
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)