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 {
|
||||
@WorkerThread
|
||||
override fun onContactsLoaded() {
|
||||
val friend = coreContext.contactsManager.findContactById(refKey)
|
||||
if (friend != null && friend != this@ContactViewModel.friend) {
|
||||
if (!::friend.isInitialized) return
|
||||
|
||||
val found = coreContext.contactsManager.findContactById(refKey)
|
||||
if (found != null && found != friend) {
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,6 +192,7 @@ class HistoryViewModel
|
|||
@UiThread
|
||||
fun startAudioCall() {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
if (!::address.isInitialized) return@postOnCoreThread
|
||||
coreContext.startAudioCall(address)
|
||||
}
|
||||
}
|
||||
|
|
@ -199,6 +200,7 @@ class HistoryViewModel
|
|||
@UiThread
|
||||
fun startVideoCall() {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
if (!::address.isInitialized) return@postOnCoreThread
|
||||
coreContext.startVideoCall(address)
|
||||
}
|
||||
}
|
||||
|
|
@ -218,6 +220,8 @@ class HistoryViewModel
|
|||
@UiThread
|
||||
fun goToConversation() {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
if (!::address.isInitialized) return@postOnCoreThread
|
||||
|
||||
val account = core.defaultAccount
|
||||
val localSipUri = account?.params?.identityAddress?.asStringUriOnly()
|
||||
if (!localSipUri.isNullOrEmpty()) {
|
||||
|
|
@ -315,11 +319,10 @@ class HistoryViewModel
|
|||
@UiThread
|
||||
fun goToMeetingWaitingRoom() {
|
||||
coreContext.postOnCoreThread {
|
||||
if (::address.isInitialized) {
|
||||
if (!::address.isInitialized) return@postOnCoreThread
|
||||
conferenceToJoinEvent.postValue(Event(address.asStringUriOnly()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun computeCallLogs() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue