mirror of https://github.com/apache/nifi.git
NIFI-6916 - handle null text message in JMSConsumer
This closes #3919. Signed-off-by: Mark Payne <markap14@hotmail.com>
This commit is contained in:
parent
442858127b
commit
3c3eba1909
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue