NIFI-6916 - handle null text message in JMSConsumer

This closes #3919.

Signed-off-by: Mark Payne <markap14@hotmail.com>
This commit is contained in:
Pierre Villard 2019-12-06 05:43:39 +01:00 committed by Mark Payne
parent 442858127b
commit 3c3eba1909
1 changed files with 3 additions and 2 deletions

View File

@ -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;