mirror of https://github.com/go-redis/redis.git
Merge pull request #1058 from go-redis/fix/panic-multi-bulk-parser
Don't panic if multi bulk parser is nil
This commit is contained in:
commit
5b3e40b336
|
@ -82,6 +82,10 @@ func (r *Reader) ReadReply(m MultiBulkParse) (interface{}, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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 m(r, n)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("redis: can't parse %.100q", line)
|
return nil, fmt.Errorf("redis: can't parse %.100q", line)
|
||||||
|
|
Loading…
Reference in New Issue