From 3218eda4819a5a41537ab31ccc2d2ecab6353a75 Mon Sep 17 00:00:00 2001 From: fatedier Date: Mon, 14 Mar 2016 00:39:32 +0800 Subject: [PATCH] models/server: fix bug, program will core if listener is nil --- src/frp/models/server/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frp/models/server/server.go b/src/frp/models/server/server.go index e8d6d810..0b9f38a2 100644 --- a/src/frp/models/server/server.go +++ b/src/frp/models/server/server.go @@ -128,7 +128,9 @@ func (p *ProxyServer) Start() (err error) { func (p *ProxyServer) Close() { p.Lock() p.Status = consts.Idle - p.listener.Close() + if p.listener != nil { + p.listener.Close() + } close(p.ctlMsgChan) close(p.cliConnChan) p.userConnList = list.New()