From f536e4537866fbb0ad62c64e8410c3023d57b959 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Tue, 13 Jan 2015 10:14:47 -1000 Subject: [PATCH] don't fail on null received text parts Fixes #2340 // FREEBIE --- src/org/thoughtcrime/securesms/mms/PartParser.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/mms/PartParser.java b/src/org/thoughtcrime/securesms/mms/PartParser.java index 8d3fbc4f1f..d43c0ed4c7 100644 --- a/src/org/thoughtcrime/securesms/mms/PartParser.java +++ b/src/org/thoughtcrime/securesms/mms/PartParser.java @@ -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!";