mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
avoid UninitializedPropertyAccessException for spreedCapabilities
reported issue on gplay console was: Exception kotlin.UninitializedPropertyAccessException: lateinit property spreedCapabilities has not been initialized at com.nextcloud.talk.chat.ChatActivity.getSpreedCapabilities (ChatActivity.kt:284) at com.nextcloud.talk.chat.ChatActivity.processExpiredMessages (ChatActivity.kt:2536) at com.nextcloud.talk.chat.ChatActivity.access$processExpiredMessages (ChatActivity.kt:204) at com.nextcloud.talk.chat.ChatActivity$initObservers$10$1.invokeSuspend (ChatActivity.kt:820) This is just a hotfix while hoping processExpiredMessages is executed again while spreedCapabilities are available. To improve the situation in the long term, we should move more logic to viewModel and have better control over sequence of actions. Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
3d9d6942e4
commit
aeacfa09b6
@ -2535,9 +2535,13 @@ class ChatActivity :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this::spreedCapabilities.isInitialized) {
|
||||||
if (CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.MESSAGE_EXPIRATION)) {
|
if (CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.MESSAGE_EXPIRATION)) {
|
||||||
deleteExpiredMessages()
|
deleteExpiredMessages()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Log.w(TAG, "spreedCapabilities are not initialized in processExpiredMessages()")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateReadStatusOfAllMessages(xChatLastCommonRead: Int?) {
|
private fun updateReadStatusOfAllMessages(xChatLastCommonRead: Int?) {
|
||||||
|
Loading…
Reference in New Issue
Block a user