diff --git a/src/main/com/zeroclue/jmeter/protocol/amqp/AMQPConsumer.java b/src/main/com/zeroclue/jmeter/protocol/amqp/AMQPConsumer.java index 369797b..dbec681 100644 --- a/src/main/com/zeroclue/jmeter/protocol/amqp/AMQPConsumer.java +++ b/src/main/com/zeroclue/jmeter/protocol/amqp/AMQPConsumer.java @@ -365,13 +365,18 @@ private String formatHeaders(QueueingConsumer.Delivery delivery) { .append(": ") .append(delivery.getEnvelope().getRoutingKey()) .append("\n"); - sb.append(DELIVERY_TAG_PARAMETER).append(": ").append(delivery.getEnvelope().getDeliveryTag()).append("\n"); + sb.append(DELIVERY_TAG_PARAMETER) + .append(": ") + .append(delivery.getEnvelope().getDeliveryTag()) + .append("\n"); - for (String key : headers.keySet()) { - sb.append(key) - .append(": ") - .append(headers.get(key)) - .append("\n"); + if (headers != null) { + for (String key : headers.keySet()) { + sb.append(key) + .append(": ") + .append(headers.get(key)) + .append("\n"); + } } return sb.toString();