Fix for NPE when MMS From is absent

Fixes #6115
// FREEBIE
This commit is contained in:
Moxie Marlinspike 2017-01-29 13:16:10 -08:00
parent 67cab3ce86
commit 4fb8d1fa49

View File

@ -832,7 +832,10 @@ public class MmsDatabase extends MessagingDatabase {
contentValues.put(DATE_SENT, contentValues.getAsLong(DATE_RECEIVED));
long messageId = db.insert(TABLE_NAME, null, contentValues);
if (headers.getEncodedStringValue(PduHeaders.FROM) != null) {
addressDatabase.insertAddressesForId(messageId, MmsAddresses.forFrom(Util.toIsoString(notification.getFrom().getTextString())));
}
return new Pair<>(messageId, threadId);
}