kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject git commit: kafka-891; NullPointerException in ConsoleConsumer; patched by Colin B.; reviewed by Neha Narkhede and Jun Rao
Date Thu, 30 May 2013 04:26:21 GMT
Updated Branches:
  refs/heads/trunk 731ba9007 -> 3b470f56b


kafka-891; NullPointerException in ConsoleConsumer; patched by Colin B.; reviewed by Neha
Narkhede and Jun Rao


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/3b470f56
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/3b470f56
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/3b470f56

Branch: refs/heads/trunk
Commit: 3b470f56b479f618b7e90577f9857b4e25b38c1a
Parents: 731ba90
Author: Colin B <lanzaa+asf@gmail.com>
Authored: Wed May 29 21:25:34 2013 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Wed May 29 21:25:34 2013 -0700

----------------------------------------------------------------------
 .../scala/kafka/consumer/ConsoleConsumer.scala     |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/3b470f56/core/src/main/scala/kafka/consumer/ConsoleConsumer.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/consumer/ConsoleConsumer.scala b/core/src/main/scala/kafka/consumer/ConsoleConsumer.scala
index d6c4a51..9b566b9 100644
--- a/core/src/main/scala/kafka/consumer/ConsoleConsumer.scala
+++ b/core/src/main/scala/kafka/consumer/ConsoleConsumer.scala
@@ -282,10 +282,10 @@ class DefaultMessageFormatter extends MessageFormatter {
   
   def writeTo(key: Array[Byte], value: Array[Byte], output: PrintStream) {
     if(printKey) {
-      output.write(key)
+      output.write(if (key == null) "null".getBytes() else key)
       output.write(keySeparator)
     }
-    output.write(value)
+    output.write(if (value == null) "null".getBytes() else value)
     output.write(lineSeparator)
   }
 }


Mime
View raw message