NIFI-1684 fixed NPE in PutKafka when retrieving key attribute bytes

Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
Oleg Zhurakousky 2016-03-24 14:35:40 -04:00 committed by joewitt
parent e35c40b0fd
commit 8d960f5243
1 changed files with 1 additions and 1 deletions

View File

@ -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;