Explorar o código

Fix nil-pointer panic in consumer.

As was revealed during real-world use, if the broker we start with errors (and
returns a nil response) but we successfully find a new broker to talk to, we
have to start the loop again to get an actual response from the new broker.
Proceeding with the nil response just causes it to panic immediately.

Add the missing `continue` statement.
Evan Huus %!s(int64=12) %!d(string=hai) anos
pai
achega
6b3b02e129
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      consumer.go

+ 1 - 0
consumer.go

@@ -156,6 +156,7 @@ func (c *Consumer) fetchMessages() {
 					return
 				}
 			}
+			continue
 		}
 
 		block := response.GetBlock(c.topic, c.partition)