joewitt commented on code in PR #7760:
URL: https://github.com/apache/nifi/pull/7760#discussion_r1337705139


##########
nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFilePackagerV3.java:
##########
@@ -36,8 +36,8 @@ public void packageFlowFile(final InputStream in, final 
OutputStream out, final
         } else {
             writeFieldLength(out, attributes.size()); //write out the number 
of attributes
             for (final Map.Entry<String, String> entry : 
attributes.entrySet()) { //write out each attribute key/value pair
-                writeString(entry.getKey(), out);
-                writeString(entry.getValue(), out);
+                writeString(entry.getKey() == null ? "" : entry.getKey(), out);

Review Comment:
   I see.  Yeah if that were just test code then fair enough.  But it being in 
the actual packager and the way it handles it makes it seem like that would be 
ok/handled.  We dont want to give that impression.  If you detect a null key 
you should reject the whole thing (the given flowfile/attrs are not valid and 
should not be packaged).  I recommend simply not doing this null check and 
fixing anything that tried to pass nulls.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to