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);
|
mChatRoom.getPeerAddress().asStringUriOnly(), mShareInfos);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ChatRoom chatRoom = lc.getChatRoom(searchResult.getAddress());
|
Address address = searchResult.getAddress();
|
||||||
LinphoneActivity.instance()
|
if (address == null) {
|
||||||
.goToChat(chatRoom.getPeerAddress().asStringUriOnly(), mShareInfos);
|
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 {
|
} else {
|
||||||
|
|
|
@ -228,11 +228,6 @@ public class SearchContactsAdapter extends RecyclerView.Adapter<SearchContactVie
|
||||||
.getContactListFromFilter(search, mOnlySipContact ? domain : "");
|
.getContactListFromFilter(search, mOnlySipContact ? domain : "");
|
||||||
|
|
||||||
for (SearchResult sr : searchResults) {
|
for (SearchResult sr : searchResults) {
|
||||||
if (sr.getAddress() != null) {
|
|
||||||
Log.e("### " + sr.getPhoneNumber() + " / " + sr.getAddress().asString());
|
|
||||||
} else {
|
|
||||||
Log.e("### " + sr.getPhoneNumber());
|
|
||||||
}
|
|
||||||
if (LinphoneActivity.instance()
|
if (LinphoneActivity.instance()
|
||||||
.getResources()
|
.getResources()
|
||||||
.getBoolean(R.bool.hide_sip_contacts_without_presence)) {
|
.getBoolean(R.bool.hide_sip_contacts_without_presence)) {
|
||||||
|
|
Loading…
Reference in a new issue