ARTEMIS-1874 fix NPE setting object property
This commit is contained in:
parent
6e6a76deab
commit
4d492bea0e
|
@ -965,7 +965,7 @@ public class ActiveMQMessage implements javax.jms.Message {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
|
||||||
if (jmsPropertyName.equals(name)) {
|
if (jmsPropertyName.equals(name)) {
|
||||||
message.putStringProperty(corePropertyName, value.toString());
|
message.putStringProperty(corePropertyName, value == null ? null : value.toString());
|
||||||
|
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import javax.jms.Session;
|
||||||
import javax.jms.StreamMessage;
|
import javax.jms.StreamMessage;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
|
import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
|
||||||
|
import org.apache.activemq.artemis.reader.MessageUtil;
|
||||||
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
||||||
import org.apache.activemq.artemis.tests.util.JMSTestBase;
|
import org.apache.activemq.artemis.tests.util.JMSTestBase;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
@ -193,6 +194,10 @@ public class MessageTest extends JMSTestBase {
|
||||||
|
|
||||||
msg.setObjectProperty(MessageTest.propName1, null);
|
msg.setObjectProperty(MessageTest.propName1, null);
|
||||||
|
|
||||||
|
msg.setObjectProperty(MessageUtil.JMSXGROUPID, null);
|
||||||
|
|
||||||
|
msg.setObjectProperty(MessageUtil.JMSXUSERID, null);
|
||||||
|
|
||||||
msg.setStringProperty(MessageTest.propName2, null);
|
msg.setStringProperty(MessageTest.propName2, null);
|
||||||
|
|
||||||
msg.getStringProperty(MessageTest.propName1);
|
msg.getStringProperty(MessageTest.propName1);
|
||||||
|
|
Loading…
Reference in New Issue