check if hub is initialized.

pull/432/head
Darien Raymond 2017-02-05 08:38:25 +01:00
parent 08bed9e768
commit 05626ca0fe
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 4 additions and 2 deletions

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() {