Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.8
-
None
Description
If the ReplyTo exchange is not set on a message read by the Java client, and
getJMSReplyTo is called, the code does not properly handle the exchange being
null.
In the following code, replyTo.getExchange() returns null, so the String
exchange is set to null, and thus the first argument to generateDestination
ends up being null.
AMQMessageDelegate_0_10.getJMSReplyTo() line: 224
if (dest == null)
{
String exchange = replyTo.getExchange();
String routingKey = replyTo.getRoutingKey();
dest = generateDestination(exchange == null ? null : new
AMQShortString(exchange),
routingKey == null ? null : new
AMQShortString(routingKey));
In the following code, you can see that if the first argument (exchange) is
null, you'll get a null pointer exception when the code attempts to call
exchange.asString().
protected AMQDestination generateDestination(AMQShortString exchange,
AMQShortString routingKey)
{
AMQDestination dest;
ExchangeInfo exchangeInfo = _exchangeMap.get(exchange.asString());