Explorar o código

check if hub is initialized.

Darien Raymond %!s(int64=8) %!d(string=hai) anos
pai
achega
05626ca0fe
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      app/proxyman/inbound/worker.go

+ 4 - 2
app/proxyman/inbound/worker.go

@@ -245,8 +245,10 @@ func (w *udpWorker) Start() error {
 }
 
 func (w *udpWorker) Close() {
-	w.hub.Close()
-	w.cancel()
+	if w.hub != nil {
+		w.hub.Close()
+		w.cancel()
+	}
 }
 
 func (w *udpWorker) monitor() {