activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [activemq] branch activemq-5.15.x updated: [AMQ-7347] Fix potential NPE when JMSException doesn't contain linkedException
Date Tue, 10 Mar 2020 06:21:09 GMT
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch activemq-5.15.x
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/activemq-5.15.x by this push:
     new d415447  [AMQ-7347] Fix potential NPE when JMSException doesn't contain linkedException
d415447 is described below

commit d415447a3864c3f447b457015f8220f8d7ca3737
Author: jbonofre <jbonofre@apache.org>
AuthorDate: Tue Mar 10 06:23:27 2020 +0100

    [AMQ-7347] Fix potential NPE when JMSException doesn't contain linkedException
    
    (cherry picked from commit 58f5fdb572520a1b0565ab831657a2cba7e5abcb)
---
 .../org/apache/activemq/transport/stomp/ProtocolConverter.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
index 7f12951..a7ff21e 100644
--- a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
+++ b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
@@ -258,7 +258,12 @@ public class ProtocolConverter {
             LOG.warn("Exception occurred while processing a command: {}", exception.toString());
         } else {
             if (exception instanceof JMSException) {
-                LOG.warn("Exception occurred for client {} ({}) processing: {} -> {} ({})",
connectionInfo.getClientId(), connectionInfo.getClientIp(), safeGetAction(command), exception.toString(),
((JMSException) exception).getLinkedException().toString());
+                JMSException jmsException = (JMSException) exception;
+                if (jmsException.getLinkedException() != null) {
+                    LOG.warn("Exception occurred for client {} ({}) processing: {} ->
{} ({})", connectionInfo.getClientId(), connectionInfo.getClientIp(), safeGetAction(command),
exception.toString(), jmsException.getLinkedException().toString());
+                } else {
+                    LOG.warn("Exception occurred for client {} ({}) processing: {} ->
{}", connectionInfo.getClientId(), connectionInfo.getClientIp(), safeGetAction(command), exception.toString());
+                }
             } else {
                 LOG.warn("Exception occurred for client {} ({}) processing: {} -> {}",
connectionInfo.getClientId(), connectionInfo.getClientIp(), safeGetAction(command), exception.toString());
             }


Mime
View raw message