Fix crash observed on PlayStore

This commit is contained in:
Benoit Marty 2019-08-07 13:16:04 +02:00
parent 35229882e3
commit 12a0cbb400
1 changed files with 5 additions and 5 deletions

View File

@ -29,7 +29,7 @@ import javax.inject.Inject
class SasVerificationViewModel @Inject constructor() : ViewModel(),
SasVerificationService.SasVerificationListener {
SasVerificationService.SasVerificationListener {
companion object {
@ -40,7 +40,7 @@ class SasVerificationViewModel @Inject constructor() : ViewModel(),
const val NAVIGATE_CANCELLED = "NAVIGATE_CANCELLED"
}
lateinit var sasVerificationService: SasVerificationService
private lateinit var sasVerificationService: SasVerificationService
var otherUserId: String? = null
var otherDeviceId: String? = null
@ -154,8 +154,8 @@ class SasVerificationViewModel @Inject constructor() : ViewModel(),
override fun onCleared() {
super.onCleared()
sasVerificationService.removeListener(this)
if (::sasVerificationService.isInitialized) {
sasVerificationService.removeListener(this)
}
}
}