From ff7f97d9a27894892e212b09efea63289ed95ed8 Mon Sep 17 00:00:00 2001 From: dingjun Date: Sat, 13 Apr 2019 17:26:37 +0800 Subject: [PATCH] fix nil pointer issue --- proxy_local/http2_proxy.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proxy_local/http2_proxy.go b/proxy_local/http2_proxy.go index 9a5db10..a1ee129 100644 --- a/proxy_local/http2_proxy.go +++ b/proxy_local/http2_proxy.go @@ -239,9 +239,11 @@ func (p *clientConn) MarkDead(conn *http2.ClientConn) { p.lock.Lock() defer p.lock.Unlock() - log.Errorln("mark dead") - p.conn.Close() - p.conn = nil + if p.conn != nil { + log.Errorln("mark dead") + p.conn.Close() + p.conn = nil + } } var debug bool