mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-22 16:07:30 +00:00
Fix for notification NPE on unknown sender.
This commit is contained in:
parent
f73adfc8f5
commit
5bf5b404a1
@ -306,18 +306,26 @@ public class MessageNotifier {
|
|||||||
|
|
||||||
private static Recipients getRecipients(Context context, Cursor cursor) {
|
private static Recipients getRecipients(Context context, Cursor cursor) {
|
||||||
String type = cursor.getString(cursor.getColumnIndexOrThrow(MmsSmsDatabase.TRANSPORT));
|
String type = cursor.getString(cursor.getColumnIndexOrThrow(MmsSmsDatabase.TRANSPORT));
|
||||||
|
Recipients recipients = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (type.equals("sms")) {
|
if (type.equals("sms")) {
|
||||||
return getSmsRecipient(context, cursor);
|
recipients = getSmsRecipient(context, cursor);
|
||||||
} else {
|
} else {
|
||||||
return getMmsRecipient(context, cursor);
|
recipients = getMmsRecipient(context, cursor);
|
||||||
}
|
}
|
||||||
} catch (RecipientFormattingException e) {
|
} catch (RecipientFormattingException e) {
|
||||||
Log.w("MessageNotifier", e);
|
Log.w("MessageNotifier", e);
|
||||||
return new Recipients(new Recipient("Unknown", "Unknown", null,
|
return new Recipients(new Recipient("Unknown", "Unknown", null,
|
||||||
ContactPhotoFactory.getDefaultContactPhoto(context)));
|
ContactPhotoFactory.getDefaultContactPhoto(context)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (recipients == null || recipients.isEmpty()) {
|
||||||
|
recipients = new Recipients(new Recipient("Unknown", "Unknown", null,
|
||||||
|
ContactPhotoFactory.getDefaultContactPhoto(context)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return recipients;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setNotificationAlarms(Context context,
|
private static void setNotificationAlarms(Context context,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user