From b60e8b14c592024904a149a442d32f7bbf0f6b96 Mon Sep 17 00:00:00 2001 From: pg9182 <96569817+pg9182@users.noreply.github.com> Date: Sat, 15 Oct 2022 08:37:56 -0400 Subject: pkg/api/api0: Add nil check to ServerList.freeServer --- pkg/api/api0/serverlist.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/api/api0') 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) -- cgit v1.2.3