From 246d502457bdc6cba3a705b6cb4e3b5cd63ce6e2 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Sun, 16 Jun 2019 14:06:13 +0300 Subject: [PATCH] Don't panic if multi bulk parser is nil --- internal/proto/reader.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/proto/reader.go b/internal/proto/reader.go index 896b6f6..7a9755a 100644 --- a/internal/proto/reader.go +++ b/internal/proto/reader.go @@ -82,6 +82,10 @@ func (r *Reader) ReadReply(m MultiBulkParse) (interface{}, error) { if err != nil { return nil, err } + if m == nil { + err := fmt.Errorf("redis: got %.100q, but multi bulk parser is nil", line) + return nil, err + } return m(r, n) } return nil, fmt.Errorf("redis: can't parse %.100q", line)