Selaa lähdekoodia

check if hub is initialized.

Darien Raymond 8 vuotta sitten
vanhempi
commit
05626ca0fe
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  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() {