lib/message_driver/adapters/bunny_adapter.rb in message-driver-0.7.1 vs lib/message_driver/adapters/bunny_adapter.rb in message-driver-0.7.2

- old
+ new

@@ -193,14 +193,15 @@ rescue => e error_handler.call(e, message) unless error_handler.nil? end def nack_message(e, message) + return if message.nil? requeue = true if e.is_a?(DontRequeue) || (options[:retry_redelivered] == false && message.redelivered?) requeue = false end - if sub_ctx.valid? + if !sub_ctx.nil? && sub_ctx.valid? begin sub_ctx.nack_message(message, requeue: requeue) rescue => e logger.error exception_to_str(e) end