wieseljonas / java-libpst

Automatically exported from code.google.com/p/java-libpst
1 stars 1 forks source link

null pointer exception in getNameToIdMapItem #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
this.nameToId.get(key) can return a null pointer if key isn't in the map.  
This will happen with some PST files if a certain named attribute doesn't 
appear anywhere in the file and you try to access that attribute for a 
PSTContact.

Easy fix is to return -1 from getNameToIdMapItem() if this.nameToId.get() 
returns null.  This is safe as getStringItem() won't find -1 in its items 
map and simply returns an empty string.

Orin.

Original issue reported on code.google.com by orin.e...@gmail.com on 21 May 2010 at 11:56

GoogleCodeExporter commented 9 years ago
coolio, I've done this as well.

Original comment by rjohnson...@gmail.com on 18 Jun 2010 at 3:27