diff --git a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/MessageBodyToBytesConverter.java b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/MessageBodyToBytesConverter.java index e23e795750..7dd77e48eb 100644 --- a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/MessageBodyToBytesConverter.java +++ b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/MessageBodyToBytesConverter.java @@ -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;