fix: add nil check in Forwarder.Close to avoid panic (issue #36)
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 4m8s

This commit is contained in:
2025-12-12 15:36:07 +07:00
parent 102c975388
commit 2725975d82

View File

@ -171,7 +171,7 @@ func (f *Forwarder) WriteBadGatewayResponse(dst io.Writer) {
}
func (f *Forwarder) Close() error {
if f.GetTunnelType() != types.HTTP {
if f.GetListener() != nil {
return f.Listener.Close()
}
return nil