Check if result of interpret url is null or not to prevent crash (previously handled by exception)
This commit is contained in:
parent
0590ef5846
commit
31feeb9ff3
4 changed files with 4 additions and 1 deletions
|
@ -400,6 +400,7 @@ public class ChatFragment extends Fragment implements OnClickListener, ChatMessa
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
lAddress = lc.interpretUrl(sipUri);
|
lAddress = lc.interpretUrl(sipUri);
|
||||||
|
if (lAddress == null) LinphoneActivity.instance().goToDialerFragment();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//TODO Error popup
|
//TODO Error popup
|
||||||
LinphoneActivity.instance().goToDialerFragment();
|
LinphoneActivity.instance().goToDialerFragment();
|
||||||
|
|
|
@ -658,6 +658,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
||||||
Address lAddress = null;
|
Address lAddress = null;
|
||||||
if(sipUri != null) {
|
if(sipUri != null) {
|
||||||
lAddress = LinphoneManager.getLc().interpretUrl(sipUri);
|
lAddress = LinphoneManager.getLc().interpretUrl(sipUri);
|
||||||
|
if (lAddress == null) return;
|
||||||
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
||||||
displayName = contact != null ? contact.getFullName() : null;
|
displayName = contact != null ? contact.getFullName() : null;
|
||||||
|
|
||||||
|
|
|
@ -569,6 +569,7 @@ public class LinphoneManager implements CoreListener, ChatMessageListener, Senso
|
||||||
|
|
||||||
Address lAddress;
|
Address lAddress;
|
||||||
lAddress = mLc.interpretUrl(to);
|
lAddress = mLc.interpretUrl(to);
|
||||||
|
if (lAddress == null) return;
|
||||||
if (mR.getBoolean(R.bool.forbid_self_call) && lpc != null && lAddress.asStringUriOnly().equals(lpc.getIdentityAddress())) {
|
if (mR.getBoolean(R.bool.forbid_self_call) && lpc != null && lAddress.asStringUriOnly().equals(lpc.getIdentityAddress())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit aaf0eac9c79b8f69abba752a29c6b12ce18ed957
|
Subproject commit c0a2fcd05dd46f1202cee980127dd96db82f1855
|
Loading…
Reference in a new issue