Skip to content

Commit

Permalink
Fix: nil check on buffer pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
yunginnanet committed Jun 21, 2024
1 parent be9700a commit da2fadd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (pre *Preset) ReadBytes() ([]byte, error) {
}

func (shim *PresetIO) Read(p []byte) (int, error) {
if shim.buf.Len() > 0 {
if shim.buf != nil && shim.buf.Len() > 0 {
return shim.buf.Read(p) //nolint:wrapcheck
}
data, err := shim.p.ReadBytes()
Expand Down

0 comments on commit da2fadd

Please sign in to comment.