diff --git a/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java b/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java index 7fac237218..7d8068176b 100755 --- a/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java +++ b/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java @@ -312,13 +312,13 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { public char getChar(String name) throws JMSException { initializeReading(); Object value = map.get(name); + if (value == null) { throw new NullPointerException(); - } - if (value instanceof Character) { + } else if (value instanceof Character) { return ((Character)value).charValue(); } else { - throw new MessageFormatException(" cannot read a short from " + value.getClass().getName()); + throw new MessageFormatException(" cannot read a char from " + value.getClass().getName()); } }