mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Fixed crash due to empty routes & when setting an empty one in account params
This commit is contained in:
parent
3711fd749e
commit
ff98c15840
1 changed files with 5 additions and 2 deletions
|
|
@ -27,6 +27,7 @@ import org.linphone.LinphoneApplication.Companion.coreContext
|
|||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.core.AVPFMode
|
||||
import org.linphone.core.Account
|
||||
import org.linphone.core.Address
|
||||
import org.linphone.core.AuthInfo
|
||||
import org.linphone.core.Factory
|
||||
import org.linphone.core.NatPolicy
|
||||
|
|
@ -155,7 +156,9 @@ class AccountSettingsViewModel
|
|||
selectedTransport.postValue(transportType)
|
||||
|
||||
sipProxyServer.postValue(params.serverAddress?.asStringUriOnly())
|
||||
outboundProxyServer.postValue(params.routesAddresses.first().asStringUriOnly())
|
||||
if (params.routesAddresses.isNotEmpty()) {
|
||||
outboundProxyServer.postValue(params.routesAddresses.first().asStringUriOnly())
|
||||
}
|
||||
|
||||
natPolicy = params.natPolicy ?: core.createNatPolicy()
|
||||
stunServer.postValue(natPolicy.stunServer)
|
||||
|
|
@ -242,7 +245,7 @@ class AccountSettingsViewModel
|
|||
Log.e("$TAG Failed to parse outbound proxy server!")
|
||||
}
|
||||
} else {
|
||||
newParams.setRoutesAddresses(null)
|
||||
newParams.setRoutesAddresses(arrayOf<Address>())
|
||||
}
|
||||
|
||||
if (::natPolicy.isInitialized) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue