1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-24 16:23:47 +03:00

fix possible panic of nil compressor

This commit is contained in:
fooofei 2020-10-04 10:38:04 +08:00
parent c877497cc9
commit bc8c5db898

View File

@ -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)