Skip to content

Commit

Permalink
Merge pull request #188 from nobonobo/fix#187
Browse files Browse the repository at this point in the history
fix shadowed thumnailReader captionReader
  • Loading branch information
porjo authored Jun 30, 2024
2 parents cfb08f5 + 7014e3a commit 4e7c191
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions run.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,21 @@ func Run(ctx context.Context, transport *limiter.LimitTransport, config Config,

var thumbReader io.ReadCloser
if config.Thumbnail != "" {
thumbReader, _, err := Open(config.Thumbnail, IMAGE)
r, _, err := Open(config.Thumbnail, IMAGE)
if err != nil {
return err
}
thumbReader = r
defer thumbReader.Close()
}

var captionReader io.ReadCloser
if config.Caption != "" {
captionReader, _, err := Open(config.Caption, CAPTION)
r, _, err := Open(config.Caption, CAPTION)
if err != nil {
return err
}
captionReader = r
defer captionReader.Close()
}

Expand Down

0 comments on commit 4e7c191

Please sign in to comment.