-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try to avoid NPE for currentConversation
On gplay console the following NPE was reported for the line participantPermissions = ParticipantPermissions(spreedCapabilities, currentConversation!!) E FATAL EXCEPTION: main Process: com.nextcloud.talk2, PID: 6626 java.lang.NullPointerException at com.nextcloud.talk.chat.ChatActivity.initObservers$lambda$13(ChatActivity.kt:583) at com.nextcloud.talk.chat.ChatActivity.$r8$lambda$QKH5JCFLmCzRMlSJ-EV-m4IW5ig(Unknown Source:0) which seems that currentConversation was null. If it would have been spreedCapabilities, then the error would have been thrown in the line before.. A reason MAY BE that the observer is triggered before setData on the ViewModel is executed. While this fix is just not executing code when currentConversation is null, it's unsure if it will follow up problems (like an empty chat) or if the observer is triggered another time when currentConversation is available. So it's just a hotfix. To improve the situation in the long term, we should move more logic to viewModel and only use Flow instead to mix it with LiveData. Signed-off-by: Marcel Hibbe <[email protected]>
- Loading branch information
1 parent
68627ad
commit b78267d
Showing
1 changed file
with
48 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters