Skip to content

Commit

Permalink
Add nil check to avoid a rare panic
Browse files Browse the repository at this point in the history
  • Loading branch information
icza committed Feb 3, 2024
1 parent b35f110 commit 47039e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion repparser/repdecoder/modern.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ func (d *modernDecoder) Section(size int32) (result []byte, sectionID int32, err
err = resetter.Reset(bytes.NewBuffer(compressed), nil)
} else {
zr, err = zlib.NewReader(bytes.NewBuffer(compressed))
defer zr.Close()
if zr != nil {
defer zr.Close()
}
}
if err != nil {
return nil, sectionID, err
Expand Down

0 comments on commit 47039e1

Please sign in to comment.