mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Fix null pointer exception
This commit is contained in:
parent
7ed4bbc471
commit
db7c360ac2
2 changed files with 20 additions and 9 deletions
|
|
@ -430,8 +430,10 @@ public class LinphonePreferences {
|
|||
prxCfg.setIdentity(identity);
|
||||
prxCfg.done();
|
||||
|
||||
info.setUsername(username);
|
||||
saveAuthInfo(info);
|
||||
if(info != null) {
|
||||
info.setUsername(username);
|
||||
saveAuthInfo(info);
|
||||
}
|
||||
} catch (LinphoneCoreException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -468,8 +470,10 @@ public class LinphonePreferences {
|
|||
|
||||
public void setAccountUserId(int n, String userId) {
|
||||
LinphoneAuthInfo info = getClonedAuthInfo(n);
|
||||
info.setUserId(userId);
|
||||
saveAuthInfo(info);
|
||||
if(info != null) {
|
||||
info.setUserId(userId);
|
||||
saveAuthInfo(info);
|
||||
}
|
||||
}
|
||||
|
||||
public String getAccountUserId(int n) {
|
||||
|
|
@ -479,8 +483,10 @@ public class LinphonePreferences {
|
|||
|
||||
public void setAccountPassword(int n, String password) {
|
||||
LinphoneAuthInfo info = getClonedAuthInfo(n);
|
||||
info.setPassword(password);
|
||||
saveAuthInfo(info);
|
||||
if(info != null) {
|
||||
info.setPassword(password);
|
||||
saveAuthInfo(info);
|
||||
}
|
||||
}
|
||||
|
||||
public String getAccountPassword(int n) {
|
||||
|
|
@ -492,8 +498,10 @@ public class LinphonePreferences {
|
|||
|
||||
try {
|
||||
LinphoneAuthInfo authInfo = getClonedAuthInfo(n);
|
||||
authInfo.setDomain(domain);
|
||||
saveAuthInfo(authInfo);
|
||||
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…
Add table
Reference in a new issue