fixed rare panic

This commit is contained in:
ston1th 2022-09-16 15:39:38 +02:00
commit 00d87ecb5c
2 changed files with 6 additions and 4 deletions

View file

@ -199,7 +199,7 @@ func (f *file) WriteAt(data []byte, pos int64) (n int, err error) {
w, e := c.writeAt(data[n:], woff)
n += w
if c.full() {
if f.w.last.cn == cn {
if f.w.last != nil && f.w.last.cn == cn {
f.w.last = nil
}
// async flush