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"); } ...
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!
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.
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!
No response for a long time, therefore I think there is not much that we can do for now, please reopen with more information if you still have this problem.
Sorry, wrong bug, reopened this again as the fix would be fairly simple here.
Looks like this was fixed in r1694255 in August last year