Summary: | An incomplete fix for the NPE bug in MAPIMessage.java | ||
---|---|---|---|
Product: | POI | Reporter: | lianggt08 |
Component: | HSMF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | lianggt08 |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
lianggt08
2012-02-14 10:08:46 UTC
nameIdChunks seems to already be null checked: if (nameIdChunks!=null) { for(Chunk c : nameIdChunks.getAll()) { if(c instanceof StringChunk) { ((StringChunk)c).set7BitEncoding(charset); } } } Is something else needed, or does this problem refer to an older version of POI? You have checked a wrong code location. Please check the line 454 of the method "has7BitEncodingStrings", not the method "set7BitEncoding". Line 454 of the method "has7BitEncodingStrings()". public boolean has7BitEncodingStrings() { for(Chunk c : mainChunks.getAll()) { if(c instanceof StringChunk) { if( ((StringChunk)c).getType() == Types.ASCII_STRING ) { return true; } } } [Line 454] for(Chunk c : nameIdChunks.getAll()) { if(c instanceof StringChunk) { if( ((StringChunk)c).getType() == Types.ASCII_STRING ) { return true; } } } for(RecipientChunks rc : recipientChunks) { for(Chunk c : rc.getAll()) { if(c instanceof StringChunk) { if( ((StringChunk)c).getType() == Types.ASCII_STRING ) { return true; } } } } return false; } |