mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Fixed crashes related to lateinit property used before being initialized found on Crashlytics
This commit is contained in:
parent
c32bac7b07
commit
70df098ee4
2 changed files with 12 additions and 7 deletions
|
|
@ -180,12 +180,14 @@ class ContactViewModel
|
||||||
private val contactsListener = object : ContactsManager.ContactsListener {
|
private val contactsListener = object : ContactsManager.ContactsListener {
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
override fun onContactsLoaded() {
|
override fun onContactsLoaded() {
|
||||||
val friend = coreContext.contactsManager.findContactById(refKey)
|
if (!::friend.isInitialized) return
|
||||||
if (friend != null && friend != this@ContactViewModel.friend) {
|
|
||||||
|
val found = coreContext.contactsManager.findContactById(refKey)
|
||||||
|
if (found != null && found != friend) {
|
||||||
Log.i(
|
Log.i(
|
||||||
"$TAG Found contact [${friend.name}] matching ref key [$refKey] after contacts have been loaded/updated"
|
"$TAG Found contact [${found.name}] matching ref key [$refKey] after contacts have been loaded/updated"
|
||||||
)
|
)
|
||||||
this@ContactViewModel.friend = friend
|
friend = found
|
||||||
refreshContactInfo()
|
refreshContactInfo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,7 @@ class HistoryViewModel
|
||||||
@UiThread
|
@UiThread
|
||||||
fun startAudioCall() {
|
fun startAudioCall() {
|
||||||
coreContext.postOnCoreThread { core ->
|
coreContext.postOnCoreThread { core ->
|
||||||
|
if (!::address.isInitialized) return@postOnCoreThread
|
||||||
coreContext.startAudioCall(address)
|
coreContext.startAudioCall(address)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -199,6 +200,7 @@ class HistoryViewModel
|
||||||
@UiThread
|
@UiThread
|
||||||
fun startVideoCall() {
|
fun startVideoCall() {
|
||||||
coreContext.postOnCoreThread { core ->
|
coreContext.postOnCoreThread { core ->
|
||||||
|
if (!::address.isInitialized) return@postOnCoreThread
|
||||||
coreContext.startVideoCall(address)
|
coreContext.startVideoCall(address)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -218,6 +220,8 @@ class HistoryViewModel
|
||||||
@UiThread
|
@UiThread
|
||||||
fun goToConversation() {
|
fun goToConversation() {
|
||||||
coreContext.postOnCoreThread { core ->
|
coreContext.postOnCoreThread { core ->
|
||||||
|
if (!::address.isInitialized) return@postOnCoreThread
|
||||||
|
|
||||||
val account = core.defaultAccount
|
val account = core.defaultAccount
|
||||||
val localSipUri = account?.params?.identityAddress?.asStringUriOnly()
|
val localSipUri = account?.params?.identityAddress?.asStringUriOnly()
|
||||||
if (!localSipUri.isNullOrEmpty()) {
|
if (!localSipUri.isNullOrEmpty()) {
|
||||||
|
|
@ -315,9 +319,8 @@ class HistoryViewModel
|
||||||
@UiThread
|
@UiThread
|
||||||
fun goToMeetingWaitingRoom() {
|
fun goToMeetingWaitingRoom() {
|
||||||
coreContext.postOnCoreThread {
|
coreContext.postOnCoreThread {
|
||||||
if (::address.isInitialized) {
|
if (!::address.isInitialized) return@postOnCoreThread
|
||||||
conferenceToJoinEvent.postValue(Event(address.asStringUriOnly()))
|
conferenceToJoinEvent.postValue(Event(address.asStringUriOnly()))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue