From 0a45c0bc5a891958db8d82be00dca62818be7fd2 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Wed, 2 Jan 2013 18:15:55 -0600 Subject: [PATCH] Only increment server stats if available --- server/client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/client.go b/server/client.go index 617a04ea..52df154f 100644 --- a/server/client.go +++ b/server/client.go @@ -417,8 +417,10 @@ func (c *client) processMsg(msg []byte) { c.inMsgs++ c.inBytes += int64(len(msg)) - atomic.AddInt64(&c.srv.inMsgs, 1) - atomic.AddInt64(&c.srv.inBytes, int64(len(msg))) + if c.srv != nil { + atomic.AddInt64(&c.srv.inMsgs, 1) + atomic.AddInt64(&c.srv.inBytes, int64(len(msg))) + } if trace { c.traceMsg(msg)