Skip to content

Commit

Permalink
Merge pull request #1 from chaintraced/buxfix-2
Browse files Browse the repository at this point in the history
fix: highlight err instead of panic nil pointer
  • Loading branch information
johan-lejdung authored May 2, 2023
2 parents 43f21ab + 883e6ef commit cff825a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,10 @@ func (this *PdfReader) rebuildContentStream(content *PdfValue) ([]byte, error) {
case "/FlateDecode":
// Uncompress zlib compressed data
var out bytes.Buffer
zlibReader, _ := zlib.NewReader(bytes.NewBuffer(stream))
zlibReader, err := zlib.NewReader(bytes.NewBuffer(stream))
if err != nil {
return nil, errors.Wrap(err, "Failed to create zlib reader")
}
defer zlibReader.Close()
io.Copy(&out, zlibReader)

Expand Down

0 comments on commit cff825a

Please sign in to comment.