mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent crash if identity address couldn't be parsed
This commit is contained in:
parent
3cdcc4bb77
commit
f068b5c9ce
2 changed files with 14 additions and 2 deletions
|
|
@ -192,6 +192,18 @@ class ThirdPartySipAccountLoginViewModel
|
|||
}
|
||||
}
|
||||
val identityAddress = Factory.instance().createAddress(identity)
|
||||
if (identityAddress == null) {
|
||||
Log.e("$TAG Can't parse [$identity] as Address!")
|
||||
showRedToastEvent.postValue(
|
||||
Event(
|
||||
Pair(
|
||||
R.string.assistant_login_cant_parse_address_toast,
|
||||
R.drawable.warning_circle
|
||||
)
|
||||
)
|
||||
)
|
||||
return@postOnCoreThread
|
||||
}
|
||||
|
||||
newlyCreatedAuthInfo = Factory.instance().createAuthInfo(
|
||||
user,
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@ class PhoneNumberUtils {
|
|||
ContactsContract.CommonDataKinds.Phone.TYPE_WORK_MOBILE -> "work,cell"
|
||||
ContactsContract.CommonDataKinds.Phone.TYPE_WORK_PAGER -> "work,pager"
|
||||
ContactsContract.CommonDataKinds.BaseTypes.TYPE_CUSTOM -> {
|
||||
Log.i(
|
||||
"$TAG Found custom phone label type using default value [$default] or 'custom' if null"
|
||||
Log.d(
|
||||
"$TAG Found custom phone label type using default value [$default] or will use 'custom' if null"
|
||||
)
|
||||
default ?: "custom"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue