You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2019/07/11 22:54:06 UTC

[GitHub] [samza] shanthoosh commented on a change in pull request #1103: SAMZA-2270: Fix ConsoleLoggingSystemFactory to handle null message value.

shanthoosh commented on a change in pull request #1103: SAMZA-2270: Fix ConsoleLoggingSystemFactory to handle null message value.
URL: https://github.com/apache/samza/pull/1103#discussion_r302772483
 
 

 ##########
 File path: samza-tools/src/main/java/org/apache/samza/tools/ConsoleLoggingSystemFactory.java
 ##########
 @@ -85,7 +85,7 @@ public void register(String source) {
     @Override
     public void send(String source, OutgoingMessageEnvelope envelope) {
       String msg = String.format("OutputStream:%s Key:%s Value:%s", envelope.getSystemStream(), envelope.getKey(),
-          new String((byte[]) envelope.getMessage()));
+          envelope.getMessage() != null ? new String((byte[]) envelope.getMessage()) : null);
 
 Review comment:
   Doesn't this non-null check on the message has to be done at other places as well in this class. For instance, in getFormattedValue implementation(line number: 100) 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services