You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2014/12/15 19:20:32 UTC

[Bug 57352] New: NPE in OutlookTextExtactor

https://issues.apache.org/bugzilla/show_bug.cgi?id=57352

            Bug ID: 57352
           Summary: NPE in OutlookTextExtactor
           Product: POI
           Version: 3.10-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSMF
          Assignee: dev@poi.apache.org
          Reporter: matthiasmolle@t-online.de

The mothod getText() throws a NullPointerException when extracting text of a
msg file with an attachment that has no LongFileName:

      ...
      // Display attachment names
      // To get the attachments, use ExtractorFactory
      for(AttachmentChunks att : msg.getAttachmentFiles()) {
         String ats = att.attachLongFileName.getValue();
         if(att.attachMimeTag != null && 
               att.attachMimeTag.getValue() != null) {
            ats = att.attachMimeTag.getValue() + " = " + ats; 
         }
         s.append("Attachment: " + ats + "\n");
      }
      ...

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 57352] NPE in org.apache.poi.hsmf.extractor.OutlookTextExtactor

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57352

--- Comment #3 from Nick Burch <ap...@gagravarr.org> ---
Any chance of a file that shows the problem, and a trivial unit test that shows
it up? We can then look to fix it, but use the unit test to verify both that
it's fixed now, and that it stays fixed into the future!

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 57352] NPE in org.apache.poi.hsmf.extractor.OutlookTextExtactor

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57352

--- Comment #2 from Matze M <ma...@t-online.de> ---
Sorry, I recognized this bug while pasing a msg-file I can't give to you.

But the fix should be simple: just add "if (att.attachLongFileName != null)"
before "String ats = att.attachLongFileName.getValue();"
or insert a try-catch block inside the for-loop, as aou did for all other
values in that method.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 57352] NPE in org.apache.poi.hsmf.extractor.OutlookTextExtactor

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57352

Matze M <ma...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|NPE in OutlookTextExtactor  |NPE in
                   |                            |org.apache.poi.hsmf.extract
                   |                            |or.OutlookTextExtactor
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 57352] NPE in org.apache.poi.hsmf.extractor.OutlookTextExtactor

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57352

Nick Burch <ap...@gagravarr.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
Do you have a small file you could share that we could use to unit test this?
That'll let us ensure it's fixed, and also that it stays fixed into the future!

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org