fix crash

This commit is contained in:
YouROK
2021-03-18 16:55:01 +03:00
parent 8ac77aa482
commit fd8d00ff02

View File

@@ -90,7 +90,7 @@ func (r *Reader) Read(p []byte) (n int, err error) {
}
func (r *Reader) SetReadahead(length int64) {
if length > r.cache.capacity {
if r.cache != nil && length > r.cache.capacity {
length = r.cache.capacity
}
r.Reader.SetReadahead(length)