ConsumeEWS Fails to Read Emtpy Message Body Emails
This closes
@@ -407,11 +407,16 @@ public class ConsumeEWS extends AbstractProcessor {
MultiPartEmail mm;
if(ewsMessage.getBody().getBodyType() == BodyType.HTML){
- mm = new HtmlEmail().setHtmlMsg(bodyText);
+ mm = new HtmlEmail();
+ if(!StringUtils.isEmpty(bodyText)){
+ ((HtmlEmail)mm).setHtmlMsg(bodyText);
+ }
} else {
mm = new MultiPartEmail();
+ if(!StringUtils.isEmpty(bodyText)){
mm.setMsg(bodyText);
}
+ }
mm.setHostName("NiFi-EWS");
//from
mm.setFrom(ewsMessage.getFrom().getAddress());
