From b5928c36a32fe914686d459a706689d976240148 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Sun, 11 Dec 2022 08:59:57 +0800 Subject: [PATCH] fix: tunnel panic --- listener/inbound/tunnel.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/listener/inbound/tunnel.go b/listener/inbound/tunnel.go index e3e16281..221f4cd6 100644 --- a/listener/inbound/tunnel.go +++ b/listener/inbound/tunnel.go @@ -64,7 +64,13 @@ func (t *Tunnel) Close() error { // Address implements constant.InboundListener func (t *Tunnel) Address() string { - return t.ttl.Address() + if t.ttl != nil { + return t.ttl.Address() + } + if t.tul != nil { + return t.tul.Address() + } + return "" } // Listen implements constant.InboundListener