# HG changeset patch # User Stiletto # Date 1395223982 -14400 # Node ID ba8a4ae40e1306ad906b0cf6ef3c957a788b5fd8 # Parent ce49140fe60b21fbc33845dc733475574de4984b Fix panic when connection is reset immediately after establishing. diff -r ce49140fe60b -r ba8a4ae40e13 xmpp/xmpp.go --- 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,