Check if result of interpret url is null or not to prevent crash (previously handled by exception)

This commit is contained in:
Sylvain Berfini 2017-10-18 16:04:37 +02:00
parent 0590ef5846
commit 31feeb9ff3
4 changed files with 4 additions and 1 deletions

View file

@ -400,6 +400,7 @@ public class ChatFragment extends Fragment implements OnClickListener, ChatMessa
} else {
try {
lAddress = lc.interpretUrl(sipUri);
if (lAddress == null) LinphoneActivity.instance().goToDialerFragment();
} catch (Exception e) {
//TODO Error popup
LinphoneActivity.instance().goToDialerFragment();

View file

@ -658,6 +658,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
Address lAddress = null;
if(sipUri != null) {
lAddress = LinphoneManager.getLc().interpretUrl(sipUri);
if (lAddress == null) return;
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(lAddress);
displayName = contact != null ? contact.getFullName() : null;

View file

@ -569,6 +569,7 @@ public class LinphoneManager implements CoreListener, ChatMessageListener, Senso
Address lAddress;
lAddress = mLc.interpretUrl(to);
if (lAddress == null) return;
if (mR.getBoolean(R.bool.forbid_self_call) && lpc != null && lAddress.asStringUriOnly().equals(lpc.getIdentityAddress())) {
return;
}

@ -1 +1 @@
Subproject commit aaf0eac9c79b8f69abba752a29c6b12ce18ed957
Subproject commit c0a2fcd05dd46f1202cee980127dd96db82f1855