Merge pull request #32 from QuentinPerez/patch-1

Don't print buff if an error occurred
This commit is contained in:
Manfred Touron 2015-11-19 00:56:46 +01:00
commit dcf603df90
1 changed files with 1 additions and 0 deletions

View File

@ -340,6 +340,7 @@ func (c *Client) readLoop(done chan bool, wg *sync.WaitGroup) {
buf, err := base64.StdEncoding.DecodeString(string(msg.Data[1:]))
if err != nil {
logrus.Warnf("Invalid base64 content: %q", msg.Data[1:])
break
}
fmt.Fprintf(c.Output, string(buf))
case '1': // pong