don't fail on null received text parts

Fixes #2340
// FREEBIE
This commit is contained in:
Jake McGinty 2015-01-13 10:14:47 -10:00
parent 18961e6369
commit f536e45378

View File

@ -24,7 +24,11 @@ public class PartParser {
if (characterSet.equals(CharacterSets.MIMENAME_ANY_CHARSET))
characterSet = CharacterSets.MIMENAME_ISO_8859_1;
partText = new String(body.getPart(i).getData(), characterSet);
if (body.getPart(i).getData() != null) {
partText = new String(body.getPart(i).getData(), characterSet);
} else {
partText = "";
}
} catch (UnsupportedEncodingException e) {
Log.w("PartParser", e);
partText = "Unsupported Encoding!";