fix: add nil check in Forwarder.Close to avoid panic (issue #36) #37

Merged
bagas merged 1 commits from staging into main 2025-12-12 08:36:52 +00:00
Showing only changes of commit 2725975d82 - Show all commits

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