diff --git a/internal/aghnet/hostscontainer.go b/internal/aghnet/hostscontainer.go index 328fbd24190..a8170447d3d 100644 --- a/internal/aghnet/hostscontainer.go +++ b/internal/aghnet/hostscontainer.go @@ -139,6 +139,8 @@ type HostsRecord struct { func (rec *HostsRecord) equal(other *HostsRecord) (ok bool) { if rec == nil { return other == nil + } else if other == nil { + return false } return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)