nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ijokaruma...@apache.org
Subject [nifi] branch master updated: [NIFI-6374] ConsumeEWS fails when email attachment has no content type - ensure non null content type
Date Fri, 11 Oct 2019 06:10:40 GMT
This is an automated email from the ASF dual-hosted git repository.

ijokarumawak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 08fe648  [NIFI-6374] ConsumeEWS fails when email attachment has no content type -
ensure non null content type
08fe648 is described below

commit 08fe648b1c61ba38d6332661219ebeaf67c3486b
Author: JF Beauvais <jeanfrancois.beauvais@orange.com>
AuthorDate: Mon Jul 22 10:36:26 2019 +0200

    [NIFI-6374] ConsumeEWS fails when email attachment has no content type - ensure non null
content type
    
    This closes #3596.
    
    Signed-off-by: Koji Kawamura <ijokarumawak@apache.org>
---
 .../src/main/java/org/apache/nifi/processors/email/ConsumeEWS.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/ConsumeEWS.java
b/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/ConsumeEWS.java
index 462f405..aeeb5ee 100644
--- a/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/ConsumeEWS.java
+++ b/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/ConsumeEWS.java
@@ -454,7 +454,8 @@ public class ConsumeEWS extends AbstractProcessor {
                     FileAttachment file = (FileAttachment)x;
                     file.load();
 
-                    ByteArrayDataSource bds = new ByteArrayDataSource(file.getContent(),
file.getContentType());
+                    String type = file.getContentType() == null ? "text/plain" : file.getContentType();
+                    ByteArrayDataSource bds = new ByteArrayDataSource(file.getContent(),
type);
 
                     mm.attach(bds,file.getName(), "", EmailAttachment.ATTACHMENT);
                 } catch (MessagingException e) {


Mime
View raw message