Fixed crash if search result doesn't have an address
This commit is contained in:
parent
31e81fdd91
commit
ad7a9e351e
2 changed files with 13 additions and 8 deletions
|
@ -598,9 +598,19 @@ public class ChatRoomCreationFragment extends Fragment
|
|||
mChatRoom.getPeerAddress().asStringUriOnly(), mShareInfos);
|
||||
}
|
||||
} else {
|
||||
ChatRoom chatRoom = lc.getChatRoom(searchResult.getAddress());
|
||||
LinphoneActivity.instance()
|
||||
.goToChat(chatRoom.getPeerAddress().asStringUriOnly(), mShareInfos);
|
||||
Address address = searchResult.getAddress();
|
||||
if (address == null) {
|
||||
Log.w("[Chat Room Creation] Using search result without an address...");
|
||||
address = lc.interpretUrl(searchResult.getPhoneNumber());
|
||||
}
|
||||
if (address != null) {
|
||||
ChatRoom chatRoom = lc.getChatRoom(address);
|
||||
LinphoneActivity.instance()
|
||||
.goToChat(chatRoom.getPeerAddress().asStringUriOnly(), mShareInfos);
|
||||
} else {
|
||||
Log.e(
|
||||
"[Chat Room Creation] Can't create a chat room without a valid address !");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -228,11 +228,6 @@ public class SearchContactsAdapter extends RecyclerView.Adapter<SearchContactVie
|
|||
.getContactListFromFilter(search, mOnlySipContact ? domain : "");
|
||||
|
||||
for (SearchResult sr : searchResults) {
|
||||
if (sr.getAddress() != null) {
|
||||
Log.e("### " + sr.getPhoneNumber() + " / " + sr.getAddress().asString());
|
||||
} else {
|
||||
Log.e("### " + sr.getPhoneNumber());
|
||||
}
|
||||
if (LinphoneActivity.instance()
|
||||
.getResources()
|
||||
.getBoolean(R.bool.hide_sip_contacts_without_presence)) {
|
||||
|
|
Loading…
Reference in a new issue