mirror of
https://github.com/schollz/croc.git
synced 2024-11-28 09:35:14 +03:00
fix possible panic of nil compressor
This commit is contained in:
parent
c877497cc9
commit
bc8c5db898
@ -35,6 +35,7 @@ func compress(src []byte, dest io.Writer, level int) {
|
||||
compressor, err := flate.NewWriter(dest, level)
|
||||
if err != nil {
|
||||
log.Debugf("error level data: %v", err)
|
||||
return
|
||||
}
|
||||
if _, err := compressor.Write(src); err != nil {
|
||||
log.Debugf("error writing data: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user