Fix null pointer exception
This commit is contained in:
parent
a8679f992b
commit
4da9480656
2 changed files with 20 additions and 9 deletions
|
@ -430,8 +430,10 @@ public class LinphonePreferences {
|
|||
prxCfg.setIdentity(identity);
|
||||
prxCfg.done();
|
||||
|
||||
if(info != null) {
|
||||
info.setUsername(username);
|
||||
saveAuthInfo(info);
|
||||
}
|
||||
} catch (LinphoneCoreException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -468,9 +470,11 @@ public class LinphonePreferences {
|
|||
|
||||
public void setAccountUserId(int n, String userId) {
|
||||
LinphoneAuthInfo info = getClonedAuthInfo(n);
|
||||
if(info != null) {
|
||||
info.setUserId(userId);
|
||||
saveAuthInfo(info);
|
||||
}
|
||||
}
|
||||
|
||||
public String getAccountUserId(int n) {
|
||||
LinphoneAuthInfo authInfo = getAuthInfo(n);
|
||||
|
@ -479,9 +483,11 @@ public class LinphonePreferences {
|
|||
|
||||
public void setAccountPassword(int n, String password) {
|
||||
LinphoneAuthInfo info = getClonedAuthInfo(n);
|
||||
if(info != null) {
|
||||
info.setPassword(password);
|
||||
saveAuthInfo(info);
|
||||
}
|
||||
}
|
||||
|
||||
public String getAccountPassword(int n) {
|
||||
LinphoneAuthInfo authInfo = getAuthInfo(n);
|
||||
|
@ -492,8 +498,10 @@ public class LinphonePreferences {
|
|||
|
||||
try {
|
||||
LinphoneAuthInfo authInfo = getClonedAuthInfo(n);
|
||||
if(authInfo != null) {
|
||||
authInfo.setDomain(domain);
|
||||
saveAuthInfo(authInfo);
|
||||
}
|
||||
|
||||
LinphoneProxyConfig prxCfg = getProxyConfig(n);
|
||||
prxCfg.edit();
|
||||
|
@ -1026,7 +1034,7 @@ public class LinphonePreferences {
|
|||
}
|
||||
|
||||
public boolean isAutoStartEnabled() {
|
||||
return getConfig().getBool("app", "auto_start", false);
|
||||
return getConfig().getBool("app", "auto_start", true);
|
||||
}
|
||||
|
||||
public void setAutoStart(boolean autoStartEnabled) {
|
||||
|
|
|
@ -309,6 +309,9 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
|
|||
username = username.substring(4);
|
||||
}
|
||||
|
||||
if (username.contains("@"))
|
||||
username = username.split("@")[0];
|
||||
|
||||
if(domain.startsWith("sip:")) {
|
||||
domain = domain.substring(4);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue