Browse Source

check if hub is initialized.

Darien Raymond 8 năm trước cách đây
mục cha
commit
05626ca0fe
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  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() {