Fixed crashes
This commit is contained in:
parent
9b7361d6d9
commit
7dab94fe2c
2 changed files with 6 additions and 3 deletions
|
@ -66,10 +66,13 @@ class ApiTwentyFivePlus {
|
||||||
Address participantAddress =
|
Address participantAddress =
|
||||||
room.hasCapability(ChatRoomCapabilities.Basic.toInt())
|
room.hasCapability(ChatRoomCapabilities.Basic.toInt())
|
||||||
? room.getPeerAddress()
|
? room.getPeerAddress()
|
||||||
: room.getParticipants()[0].getAddress();
|
: room.getParticipants().length == 0
|
||||||
|
? null
|
||||||
|
: room.getParticipants()[0].getAddress();
|
||||||
|
if (participantAddress == null) continue;
|
||||||
|
|
||||||
LinphoneContact contact =
|
LinphoneContact contact =
|
||||||
ContactsManager.getInstance().findContactFromAddress(participantAddress);
|
ContactsManager.getInstance().findContactFromAddress(participantAddress);
|
||||||
|
|
||||||
if (contact != null && !contacts.contains(contact)) {
|
if (contact != null && !contacts.contains(contact)) {
|
||||||
if (context.getResources().getBoolean(R.bool.shortcut_to_contact)) {
|
if (context.getResources().getBoolean(R.bool.shortcut_to_contact)) {
|
||||||
ShortcutInfo shortcut = manager.createContactShortcutInfo(contact);
|
ShortcutInfo shortcut = manager.createContactShortcutInfo(contact);
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class SearchContactsAdapter extends RecyclerView.Adapter<SearchContactVie
|
||||||
if (mSecurityEnabled || !mIsOnlyOnePersonSelection) {
|
if (mSecurityEnabled || !mIsOnlyOnePersonSelection) {
|
||||||
Core core = LinphoneManager.getCore();
|
Core core = LinphoneManager.getCore();
|
||||||
ProxyConfig defaultProxyConfig = core.getDefaultProxyConfig();
|
ProxyConfig defaultProxyConfig = core.getDefaultProxyConfig();
|
||||||
if (defaultProxyConfig != null) {
|
if (defaultProxyConfig != null && searchResult.getAddress() != null) {
|
||||||
// SDK won't accept ourselves in the list of participants
|
// SDK won't accept ourselves in the list of participants
|
||||||
if (defaultProxyConfig.getIdentityAddress().weakEqual(searchResult.getAddress())) {
|
if (defaultProxyConfig.getIdentityAddress().weakEqual(searchResult.getAddress())) {
|
||||||
// Disable row, we can't use our own address in a group chat room
|
// Disable row, we can't use our own address in a group chat room
|
||||||
|
|
Loading…
Reference in a new issue