handle null text message in JMSConsumer
This closes
@@ -48,6 +48,9 @@ abstract class MessageBodyToBytesConverter {
*/
public static byte[] toBytes(TextMessage message, Charset charset) {
try {
+ if (message.getText() == null) {
+ return new byte[0];
+ }
if (charset == null) {
return message.getText().getBytes();
} else {
@@ -72,7 +75,6 @@ abstract class MessageBodyToBytesConverter {
}
}
-
private static class BytesMessageInputStream extends InputStream {
private BytesMessage message;
@@ -112,7 +114,6 @@ abstract class MessageBodyToBytesConverter {
}
}
-
static class MessageConversionException extends RuntimeException {
private static final long serialVersionUID = -1464448549601643887L;
