mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-22 07:57:30 +00:00
Fix for mysterious 'anonymous sender' NPE.
This commit is contained in:
parent
01a5c889b0
commit
b044a68168
@ -25,6 +25,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.CursorAdapter;
|
import android.widget.CursorAdapter;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.contacts.ContactPhotoFactory;
|
||||||
import org.thoughtcrime.securesms.crypto.MasterCipher;
|
import org.thoughtcrime.securesms.crypto.MasterCipher;
|
||||||
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||||||
import org.thoughtcrime.securesms.crypto.MessageDisplayHelper;
|
import org.thoughtcrime.securesms.crypto.MessageDisplayHelper;
|
||||||
@ -260,15 +261,20 @@ public class ConversationAdapter extends CursorAdapter {
|
|||||||
Recipient recipient;
|
Recipient recipient;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (address == null) recipient = recipients.getPrimaryRecipient();
|
if (address == null) recipient = recipients.getPrimaryRecipient();
|
||||||
else recipient = RecipientFactory.getRecipientsFromString(context, address, false).getPrimaryRecipient();
|
else recipient = RecipientFactory.getRecipientsFromString(context, address, false).getPrimaryRecipient();
|
||||||
|
|
||||||
|
if (recipient == null) recipient = new Recipient("Unknown", "Unknown", null,
|
||||||
|
ContactPhotoFactory.getDefaultContactPhoto(context));
|
||||||
} catch (RecipientFormattingException e) {
|
} catch (RecipientFormattingException e) {
|
||||||
Log.w("ConversationAdapter", e);
|
Log.w("ConversationAdapter", e);
|
||||||
recipient = new Recipient("Unknown", "Unknown", null, null);
|
recipient = new Recipient("Unknown", "Unknown", null,
|
||||||
|
ContactPhotoFactory.getDefaultContactPhoto(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
return recipient;
|
return recipient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onContentChanged() {
|
protected void onContentChanged() {
|
||||||
super.onContentChanged();
|
super.onContentChanged();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user