check if hub is initialized.

This commit is contained in:
Darien Raymond
2017-02-05 08:38:25 +01:00
parent 08bed9e768
commit 05626ca0fe
+4 -2
View File
@@ -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() {