fixed crash when deleting an account

This commit is contained in:
Juha Heinanen
2018-07-18 09:16:40 +03:00
parent 75511a8ff8
commit 8b7e875099
3 changed files with 7 additions and 3 deletions

View File

@ -8,7 +8,7 @@ android {
applicationId = 'com.tutpro.baresip' applicationId = 'com.tutpro.baresip'
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 26 targetSdkVersion 26
versionCode = 7 versionCode = 8
versionName = '1.0' versionName = '1.0'
ndk { ndk {
abiFilters 'armeabi-v7a' abiFilters 'armeabi-v7a'

View File

@ -217,7 +217,7 @@ class BaresipService: Service() {
if (!IS_SERVICE_RUNNING) return if (!IS_SERVICE_RUNNING) return
val ua = UserAgent.find(MainActivity.uas, uap) val ua = UserAgent.find(MainActivity.uas, uap)
if (ua == null) { if (ua == null) {
Log.e(LOG_TAG, "updateStatus did not find ua $uap") Log.w(LOG_TAG, "updateStatus did not find ua $uap")
return return
} }
val aor = ua.account.aor val aor = ua.account.aor

View File

@ -314,7 +314,11 @@ class MainActivity : AppCompatActivity() {
} }
private fun handleServiceEvent(event: String, uap: String, callp: String) { private fun handleServiceEvent(event: String, uap: String, callp: String) {
val ua = UserAgent.find(uas, uap)!! val ua = UserAgent.find(uas, uap)
if (ua == null) {
Log.w("Baresip", "handleServiceEvent '$event' did not find ua $uap")
return
}
val aor = ua.account.aor val aor = ua.account.aor
val acc = ua.account val acc = ua.account
val ev = event.split(",") val ev = event.split(",")