fix log trace message throwing exception

Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/355d33ea
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/355d33ea
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/355d33ea

Branch: refs/heads/master
Commit: 355d33ea4f26c492d244e5ba50ddadb52289fb84
Parents: 57de218
Author: Andy Taylor <andy.tayl...@gmail.com>
Authored: Mon Jan 9 17:32:44 2017 +0000
Committer: Clebert Suconic <clebertsuco...@apache.org>
Committed: Mon Jan 9 14:58:25 2017 -0500

----------------------------------------------------------------------
 .../artemis/protocol/amqp/proton/handler/ProtonHandler.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/355d33ea/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
----------------------------------------------------------------------
diff --git 
a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
 
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
index 71cf4a3..25ef51e 100644
--- 
a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
+++ 
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
@@ -289,7 +289,7 @@ public class ProtonHandler extends ProtonInitializable {
             serverSasl.recv(dataSASL, 0, dataSASL.length);
 
             if (log.isTraceEnabled()) {
-               log.trace("Working on sasl::" + ByteUtil.bytesToHex(dataSASL, 
2));
+               log.trace("Working on sasl::" + (dataSASL != null && 
dataSASL.length > 0 ? ByteUtil.bytesToHex(dataSASL, 2) : "Anonymous"));
             }
 
             saslResult = mechanism.processSASL(dataSASL);

Reply via email to