Fixed crashes

This commit is contained in:
Sylvain Berfini 2020-01-16 17:09:18 +01:00
parent 9b7361d6d9
commit 7dab94fe2c
2 changed files with 6 additions and 3 deletions

View file

@ -66,10 +66,13 @@ class ApiTwentyFivePlus {
Address participantAddress =
room.hasCapability(ChatRoomCapabilities.Basic.toInt())
? room.getPeerAddress()
: room.getParticipants().length == 0
? null
: room.getParticipants()[0].getAddress();
if (participantAddress == null) continue;
LinphoneContact contact =
ContactsManager.getInstance().findContactFromAddress(participantAddress);
if (contact != null && !contacts.contains(contact)) {
if (context.getResources().getBoolean(R.bool.shortcut_to_contact)) {
ShortcutInfo shortcut = manager.createContactShortcutInfo(contact);

View file

@ -124,7 +124,7 @@ public class SearchContactsAdapter extends RecyclerView.Adapter<SearchContactVie
if (mSecurityEnabled || !mIsOnlyOnePersonSelection) {
Core core = LinphoneManager.getCore();
ProxyConfig defaultProxyConfig = core.getDefaultProxyConfig();
if (defaultProxyConfig != null) {
if (defaultProxyConfig != null && searchResult.getAddress() != null) {
// SDK won't accept ourselves in the list of participants
if (defaultProxyConfig.getIdentityAddress().weakEqual(searchResult.getAddress())) {
// Disable row, we can't use our own address in a group chat room