Skip to content

Commit

Permalink
fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
reddec committed Feb 21, 2020
1 parent 341144b commit 547ccf0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions requeuer.go
Expand Up @@ -117,6 +117,9 @@ func (s *requeue) Requeue(original *amqp.Delivery) error {

func (s *requeue) RequeueWithError(original *amqp.Delivery, err error) error {
if err != nil {
if original.Headers == nil {
original.Headers = make(amqp.Table)
}
original.Headers[LastErrorHeader] = err.Error()
}
return s.Requeue(original)
Expand Down

0 comments on commit 547ccf0

Please sign in to comment.