mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-10 06:14:10 +01:00
For v21.0.0, the following crash was reported: Exception java.lang.NullPointerException: null cannot be cast to non-null type com.nextcloud.talk.chat.data.model.ChatMessage at com.nextcloud.talk.chat.ChatActivity.onLoadMore (ChatActivity.kt:3107) at com.stfalcon.chatkit.messages.MessagesListAdapter.onLoadMore (MessagesListAdapter.java:148) at com.stfalcon.chatkit.messages.RecyclerScrollMoreListener.onScrolled (RecyclerScrollMoreListener.java:82) at androidx.recyclerview.widget.RecyclerView.dispatchOnScrolled (RecyclerView.java:5688) at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep3 (RecyclerView.java:4741) at androidx.recyclerview.widget.RecyclerView.dispatchLayout (RecyclerView.java:4367) at androidx.recyclerview.widget.RecyclerView.onLayout (RecyclerView.java:4919) This is now improved: - lastOrNull prevents exceptions if no matching item is found - as? is a safe cast that returns null if the cast fails Whole expression becomes null-safe, and id will be null if anything along the way doesn't match. Only when not null, onLoadMore continues. Signed-off-by: Marcel Hibbe <dev@mhibbe.de> |
||
---|---|---|
.. | ||
schemas/com.nextcloud.talk.data.source.local.TalkDatabase | ||
src | ||
build.gradle | ||
lint.xml | ||
proguard-rules.pro |