Prevent NPE when MMS's FROM PduHeader is missing
Fixes #1448 // FREEBIE
This commit is contained in:
parent
9ffd84ce05
commit
242dbef54e
1 changed files with 5 additions and 1 deletions
|
@ -239,7 +239,7 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
|
|||
}
|
||||
}
|
||||
|
||||
private long getThreadIdFor(IncomingMediaMessage retrieved) throws RecipientFormattingException {
|
||||
private long getThreadIdFor(IncomingMediaMessage retrieved) throws RecipientFormattingException, MmsException {
|
||||
if (retrieved.getGroupId() != null) {
|
||||
Recipients groupRecipients = RecipientFactory.getRecipientsFromString(context, retrieved.getGroupId(), true);
|
||||
return DatabaseFactory.getThreadDatabase(context).getThreadIdFor(groupRecipients);
|
||||
|
@ -253,6 +253,10 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
|
|||
EncodedStringValue[] encodedCcList = headers.getEncodedStringValues(PduHeaders.CC);
|
||||
EncodedStringValue[] encodedToList = headers.getEncodedStringValues(PduHeaders.TO);
|
||||
|
||||
if (encodedFrom == null) {
|
||||
throw new MmsException("FROM value in PduHeaders did not exist.");
|
||||
}
|
||||
|
||||
group.add(new String(encodedFrom.getTextString(), CharacterSets.MIMENAME_ISO_8859_1));
|
||||
|
||||
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
|
|
Loading…
Add table
Reference in a new issue