Skip to content

Commit

Permalink
fix(adaptive):fix a panic when use flush.
Browse files Browse the repository at this point in the history
  • Loading branch information
wqshr12345 committed Nov 27, 2023
1 parent b756e65 commit 714788d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adaptive/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ func (w *Writer) write(p []byte) (nRet int, errRet error) {
if w.err != nil {
return 0, w.err
}

if p == nil || len(p) == 0 {
return 0, nil
}
oBuf := make([]byte, packageHeaderSize)

// TODO(wangqian): use a oBuf to avoid memory allocate.
Expand Down

0 comments on commit 714788d

Please sign in to comment.