From 69b1ce42d970852e0548e124846baa6f496ddf40 Mon Sep 17 00:00:00 2001
From: Juan Batiz-Benet <juan@benet.ai>
Date: Thu, 18 Sep 2014 19:42:15 -0700
Subject: [PATCH] nil muxer

---
 net/mux/mux.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/mux/mux.go b/net/mux/mux.go
index e6cf0651f..2f4e3b39e 100644
--- a/net/mux/mux.go
+++ b/net/mux/mux.go
@@ -41,6 +41,10 @@ func (m *Muxer) GetPipe() *msg.Pipe {
 
 // Start kicks off the Muxer goroutines.
 func (m *Muxer) Start(ctx context.Context) error {
+	if m == nil {
+		panic("nix muxer")
+	}
+
 	if m.cancel != nil {
 		return errors.New("Muxer already started.")
 	}
@@ -75,7 +79,12 @@ func (m *Muxer) AddProtocol(p Protocol, pid ProtocolID) error {
 // handleIncoming consumes the messages on the m.Incoming channel and
 // routes them appropriately (to the protocols).
 func (m *Muxer) handleIncomingMessages(ctx context.Context) {
+
 	for {
+		if m == nil {
+			panic("nix muxer")
+		}
+
 		select {
 		case msg := <-m.Incoming:
 			go m.handleIncomingMessage(ctx, msg)
-- 
GitLab