You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2019/05/03 00:37:42 UTC

[activemq-artemis] branch master updated: ARTEMIS-2330 Fixing Possible NPE on HQPropertiesConversionInterceptor

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f03800  ARTEMIS-2330 Fixing Possible NPE on HQPropertiesConversionInterceptor
     new 0dae70b  This closes #2658
6f03800 is described below

commit 6f0380097e5f6ce12570ccba210ef4362cdc9ca2
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Thu May 2 19:20:40 2019 -0400

    ARTEMIS-2330 Fixing Possible NPE on HQPropertiesConversionInterceptor
---
 .../core/protocol/hornetq/HQPropertiesConversionInterceptor.java     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/HQPropertiesConversionInterceptor.java b/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/HQPropertiesConversionInterceptor.java
index 05f024f..270dc0a 100644
--- a/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/HQPropertiesConversionInterceptor.java
+++ b/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/HQPropertiesConversionInterceptor.java
@@ -21,6 +21,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.core.client.impl.ClientMessageInternal;
+import org.apache.activemq.artemis.core.message.impl.CoreMessage;
 import org.apache.activemq.artemis.core.protocol.core.Packet;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.MessagePacketI;
 import org.apache.activemq.artemis.core.protocol.hornetq.util.HQPropertiesConverter;
@@ -48,7 +49,9 @@ public class HQPropertiesConversionInterceptor implements Interceptor {
 
       // there's no need to copy client messages, only the server ones are problematic
       if (!(copy instanceof ClientMessageInternal)) {
-         copy = copy.copy();
+         if (copy instanceof CoreMessage && ((CoreMessage)copy).getBuffer() != null) {
+            copy = copy.copy();
+         }
          messagePacket.replaceMessage(copy);
       }