From 8d960f52436a516776d6fe775be6c6f47645078b Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Thu, 24 Mar 2016 14:35:40 -0400 Subject: [PATCH] NIFI-1684 fixed NPE in PutKafka when retrieving key attribute bytes Signed-off-by: joewitt --- .../main/java/org/apache/nifi/processors/kafka/PutKafka.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/PutKafka.java b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/PutKafka.java index 4510038cd2..513f4f3150 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/PutKafka.java +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/PutKafka.java @@ -408,7 +408,7 @@ public class PutKafka extends AbstractProcessor { String failedSegmentsString = flowFile.getAttribute(ATTR_FAILED_SEGMENTS); if (flowFile.getAttribute(ATTR_PROC_ID) != null && flowFile.getAttribute(ATTR_PROC_ID).equals(this.getIdentifier()) && failedSegmentsString != null) { topicName = flowFile.getAttribute(ATTR_TOPIC); - key = flowFile.getAttribute(ATTR_KEY).getBytes(); + key = flowFile.getAttribute(ATTR_KEY) == null ? null : flowFile.getAttribute(ATTR_KEY).getBytes(); delimiterPattern = flowFile.getAttribute(ATTR_DELIMITER); } else { failedSegmentsString = null;