Testing object before use it

This commit is contained in:
Erwan Croze 2017-01-16 11:12:36 +01:00
parent ccfbf6d5e1
commit 1ac2ff5784

View file

@ -159,6 +159,7 @@ public class LinphonePreferences {
private LinphoneAuthInfo getAuthInfo(int n) { private LinphoneAuthInfo getAuthInfo(int n) {
LinphoneProxyConfig prxCfg = getProxyConfig(n); LinphoneProxyConfig prxCfg = getProxyConfig(n);
if (prxCfg == null) return null;
try { try {
LinphoneAddress addr = LinphoneCoreFactory.instance().createLinphoneAddress(prxCfg.getIdentity()); LinphoneAddress addr = LinphoneCoreFactory.instance().createLinphoneAddress(prxCfg.getIdentity());
LinphoneAuthInfo authInfo = getLc().findAuthInfo(addr.getUserName(), null, addr.getDomain()); LinphoneAuthInfo authInfo = getLc().findAuthInfo(addr.getUserName(), null, addr.getDomain());