xmpp/xmpp.go
changeset 185 ba8a4ae40e13
parent 180 3010996c1928
--- a/xmpp/xmpp.go	Thu Feb 20 15:55:19 2014 -0700
+++ b/xmpp/xmpp.go	Wed Mar 19 14:13:02 2014 +0400
@@ -261,7 +261,11 @@
 	cl.setStatus(StatusShutdown)
 
 	// Shuts down the senders:
-	cl.shutdownOnce.Do(func() { close(cl.Send) })
+	cl.shutdownOnce.Do(func() {
+		if cl.Send != nil {
+			close(cl.Send)
+		}
+	})
 }
 
 // If there's a buffered error in the channel, return it. Otherwise,