Skip to content

Commit dfa3681

Browse files
author
anahan
committed
Fix slowlogToZapEncoder.add() panic on empty buf
1 parent 48b76a9 commit dfa3681

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cmd/docker-fpm-wrapper/slowlog.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (sle *slowlogToZapEncoder) reset() {
2323
}
2424

2525
func (sle *slowlogToZapEncoder) add(s string) {
26-
if sle.strBuf[len(sle.strBuf)-1] == s {
26+
if l := len(sle.strBuf); l > 1 && sle.strBuf[l-1] == s {
2727
return
2828
}
2929

0 commit comments

Comments
 (0)